wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.44k stars 706 forks source link

How to fix warnings? Please help me. Thank you in advance! #2580

Closed givik closed 11 months ago

givik commented 1 year ago

Description

I am using a fresh install of Expo and RNUILib. I want to have the same UI on the WEB and Mobile.

Related to

Steps to reproduce

  1. Crete Expo App
  2. Install Libraries
  3. Run the project on a WEB
npx create-expo-app demoapp
cd demoapp
npx expo install react-dom react-native-web @expo/webpack-config
npm install react-native-ui-lib
npm i react-native-reanimated react-native-gesture-handler
npx expo start
w

Expected behavior

Warningless terminal

Actual behavior

I got a bunch of warning messages in the terminal:

warnings.log

More Info

Code snippet

App.js (This is my component nothing complex. I am just exploring the library)

import { StatusBar } from 'expo-status-bar';
import { StyleSheet } from 'react-native';
import { View, TextField, Text, Button, Typography, Colors, Spacings } from 'react-native-ui-lib';

Colors.loadColors({
  pink: '#FF69B4',
  gold: '#FFD700',
});

Typography.loadTypographies({
  h1: { fontSize: 58, fontWeight: '300', lineHeight: 80 },
  h2: { fontSize: 46, fontWeight: '300', lineHeight: 64 },
});

Spacings.loadSpacings({
  page: 16,
});

export default function App() {
  return (
    <View flex paddingH-25 paddingT-120>
      <Text h1 pink>
        Hello World
      </Text>
      <Text blue50 text20>
        Welcome
      </Text>
      <TextField text50 placeholder="username" grey10 />
      <TextField text50 placeholder="password" secureTextEntry grey10 />
      <View marginT-100 center>
        <Button text70 white background-orange30 label="Login" />
        <Button link text70 orange30 label="Sign Up" marginT-20 />
      </View>
    </View>
  );
}

Screenshots/Video

https://user-images.githubusercontent.com/2458760/236567249-14f4f66b-6166-42ee-8844-5285e5f6de9f.mp4

Environment

package.json

{
  "name": "universal-app",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/webpack-config": "^18.0.1",
    "@react-native-community/blur": "^4.3.2",
    "@react-native-community/datetimepicker": "^7.0.1",
    "@react-native-community/netinfo": "^9.3.9",
    "@react-native-picker/picker": "^2.4.10",
    "expo": "~48.0.15",
    "expo-status-bar": "~1.4.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.71.7",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-reanimated": "^3.1.0",
    "react-native-ui-lib": "^7.3.2",
    "react-native-web": "~0.18.10"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

Affected platforms

stale[bot] commented 12 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.