Started a project with create-react-app. Installed react-native: "^0.57.8",react-native-elements: "^0.19.1" and react-native-vector-icons: "^6.1.0". To be able to use components within react-native-elements within a project.
When I run npm start
I get the error code pasted below. I've read through the the react-native-elements documentation but can't seem to find anything to help me
./node_modules/react-native-elements/src/avatar/Avatar.js
SyntaxError: D:\Location-Map\Neighborhood-Map-2-\location-
app\node_modules\react-native-elements\src\avatar\Avatar.js: Unexpected
token (92:8)
90 |
91 | return (
> 92 | <TouchableHighlight
| ^
93 | style={[
94 | styles.editButton,
95 | editButtonSizeStyle,
Invariant Violation: 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.
First open Developer Tools in Simulator. Then press Command+D keyboard shortcut. It will open the developer tools. To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu.
You can't do that (read here if you want to know why). Do you want to build a web app? Use React with create-react-app
. Do you want to build a mobile app? Use React Native with Expo or react-native init
.
I suggest you look into material-ui
as a component library for React.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With