FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

Import of GiftedChat in react 16 failing #145

Closed bharath-naik closed 3 years ago

bharath-naik commented 3 years ago

Added this to my project using yarn. And followed this permalink: https://github.com/FaridSafi/react-native-gifted-chat#react-native-web Tried deleting all node_modules folder, yarn.lock, package.lock, etc. Then yarn start again. But nothing works. Whenever I run yarn start, it throws some babel error. Kindly guide how to get started with tis in reactjs? Attaching logs below.

node_modules\react-native-gifted-chat\lib\GiftedChat.js: Support for the experimental syntax 'jsx' isn't currently enabled (337:27):

335 | renderMessages() { 336 | const { messagesContainerStyle, ...messagesContainerProps } = this.props;

337 | const fragment = (<View style={[ | ^ 338 | { 339 | height: this.state.messagesContainerHeight, 340 | },

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.

P.S. already tried adding .babelrc, babel.config.js, and modifying 'plugins' section. no luck :(