octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
928 stars 157 forks source link

rn-sliding-panel no longer function with latest CRA (create react app) #162

Open ashahidrahmat opened 4 years ago

ashahidrahmat commented 4 years ago

Issue Description

Downloading the latest CRA with base template, installing this module and then running it causes the following error

\node_modules\rn-sliding-up-panel\SlidingUpPanel.js: Support for the experimental syntax 'classProperties' isn't currently enabled (35:20):

33 | 34 | class SlidingUpPanel extends React.PureComponent {

35 | static propTypes = { | ^ 36 | height: PropTypes.number, 37 | animatedValue: PropTypes.instanceOf(Animated.Value), 38 | draggableRange: PropTypes.shape({

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.

Forking a copy of the code from the website also re

ashahidrahmat commented 4 years ago

So i ejected cra and added this

presets: [ [require.resolve('babel-preset-react-app/dependencies'), { helpers: true }], '@babel/preset-react' ], "plugins": [ ["@babel/plugin-proposal-class-properties"]

            ],

Into my webpack.config.js file under the section that says // Process any JS outside of the app with Babel. // Unlike the application JS, we only compile the standard ES features. But now it is complaining that the module (rn-sliding-panel) can't resolve react-native...

ashahidrahmat commented 4 years ago

Specifically this error Module not found: Can't resolve 'react-native' in