wix / react-native-ui-lib

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

Button Component is undefined #2848

Open zh925 opened 9 months ago

zh925 commented 9 months ago

Description

I import Button and render it, has an Error.

 Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Then I console.log(Button), it was an undefined in my logs.

Related to

Steps to reproduce

import { View, Button } from 'react-native-ui-lib'

export default function MyScreen() {
    return (
        <View>
            <Button label="click" />
        </View>
    )
}

Expected behavior

render the button

Actual behavior

throw an error

More Info

Code snippet

import { View, Button } from 'react-native-ui-lib'

export default function MyScreen() {
    return (
        <View>
            <Button label="click" />
        </View>
    )
}

Screenshots/Video

Environment

it was same on react-native-ui-lib@7.12.1

Affected platforms

JacobWennebro commented 8 months ago

I have the same problem on iOS

PavelPolyakov commented 8 months ago

~Same thing, an example from the documentation: https://wix.github.io/react-native-ui-lib/docs/getting-started/usage does not work. For View, Text and TextField it does, but fails on Button.~

upd.

To me it helped to make sure that react-native-reanimated is installed following this guide: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/

Specifically, run npx expo start -c afterwards

andrewvmail commented 8 months ago

Running into the same issue image

zp342519261 commented 7 months ago

I had the same problem,It's not just Button, there are other components that have this problem as well

alvaromirandamita commented 6 months ago

I updated the libraries recommended by Expo, and it worked.

"dependencies": { "expo": "~50.0.6", "expo-status-bar": "~1.11.1", "react": "18.2.0", "react-native": "0.73.4", "react-native-calendars": "^1.1303.0", "react-native-gesture-handler": "~2.14.0", "react-native-reanimated": "~3.6.2", "react-native-ui-lib": "^7.16.0" }, "devDependencies": { "@babel/core": "^7.20.0" },

Aymenoob commented 6 months ago

same issue here

jami-yashwanth commented 5 months ago

I updated the libraries recommended by Expo, and it worked.

"dependencies": { "expo": "~50.0.6", "expo-status-bar": "~1.11.1", "react": "18.2.0", "react-native": "0.73.4", "react-native-calendars": "^1.1303.0", "react-native-gesture-handler": "~2.14.0", "react-native-reanimated": "~3.6.2", "react-native-ui-lib": "^7.16.0" }, "devDependencies": { "@babel/core": "^7.20.0" },

Updated libraries...Working!!

paulamurta commented 1 month ago

did anyone came up with any solutions? dealing with the same issue when trying to use <TextField>