@yuriazevedo/rnw-components
v0.4.0
Published
Solução de compartilhamento de código entre múltiplas plataformas, através de uma biblioteca de componentes acessíveis e customizáveis, utilizando React Native Web, Atomic Design, Storybook e Typescript.
Downloads
9
Readme
Projeto
Solução de compartilhamento de código entre múltiplas plataformas, através de uma biblioteca de componentes acessíveis e customizáveis, utilizando React Native Web, Atomic Design, Storybook e Typescript.
Stack
Esse projeto foi desenvolvido com as seguintes tecnologias:
Instalação em outro projeto
- Instale a bibliteca em seu projeto React/React Native/Expo:
yarn add @yuriazevedo/rnw-components
- Instale a dependência nativa (utilize
expo install
caso seja um projeto Expo):
yarn add react-native-vector-icons
- Agora instale as dependências:
yarn add styled-components styled-system
- Caso seu projeto utilize Typescript, instale as seguintes tipagens:
yarn add @types/styled-components @types/styled-components-react-native @types/styled-system -D
- Configurações extras para a Web
- Exemplo da propriedade
module.rules
dentro do webpack config:
{
test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/,
loader: 'file-loader',
},
{
test: /\.(ts|js)x?$/,
exclude: /node_modules[/\\](?!react-native-vector-icons)/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', { useBuiltIns: 'usage' }],
'@babel/preset-react',
"@babel/preset-typescript"
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread'
],
},
},
},
Utilizando o projeto
- Clone o repositório utilizando:
[email protected]:yuriazevedo11/monografia.git
- Entre na pasta do repositório:
cd monografia
- Agora é só instalar as dependências do projeto:
yarn # Equivalente a yarn install
yarn pod # Caso esteja rodando em um ambiente MacOS
Utilizando o Storybook
Ambiente Web
- Basta rodar o comando :
yarn storybook-web
Ambiente Android e iOS
- Inicie o Storybook com:
yarn storybook
- Em seguida inicie o Metro do React Native:
yarn start
- Agora rode o comando de acordo com a plataforma desejada:
yarn android
yarn ios # É necessário um ambiente MacOS
- Caso o Storybook não esteja reconhendo os emuladores basta rodar o comando:
yarn reverse
OBS: Os emuladores costumam abrir sozinhos após passo 3, caso seu ambiente esteja configurado corretamente com Android Studio ou Xcode (no caso de MacOS). Se ele não abrir sozinho, basta abrir o emulador antes de rodar o comando anterior.