3

I am using create-react-app and don't want to eject. Is there any-other way to fix this?

   class SlidingUpPanel extends React.Component {
   static propTypes = {
               ^
   visible: PropTypes.bool,
   height: PropTypes.number,   draggableRange: PropTypes.shape({

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

Installed @babel/plugin-proposal-class-properties already! But how to fix this without ejecting?

Nagama Inamdar
  • 2,851
  • 22
  • 39
  • 48
bilal
  • 219
  • 1
  • 5
  • 15
  • which version of react-scripts do you have? – azium Jan 04 '19 at 08:32
  • @azium `"react-scripts": "2.1.0"` – bilal Jan 04 '19 at 08:32
  • hmm strange, this should already be supported then. is the code in your `src` folder? are you getting this error in the terminal when running your code? – azium Jan 04 '19 at 08:39
  • so i am trying to use `https://github.com/octopitus/rn-sliding-up-panel` this library and yes my code is in src! and i am getting this error in terminal and also on the screen! some say you have to eject and then edit the config fine and make babelrc: true so then you can just add plugins and do more but i dont want to eject! – bilal Jan 04 '19 at 08:41
  • 1
    you shouldn't need to eject. i'm a little confused though. create-react-app is for the web. isn't that a react-native component? – azium Jan 04 '19 at 08:43
  • Oh shit! i feel dumb! i totally got it wrong! and yes i just read it. its a react native plugin *bang my head on wall* – bilal Jan 04 '19 at 08:45
  • can you recommend me something like this for web? doing pwa – bilal Jan 04 '19 at 08:45
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/186168/discussion-between-bilal-and-azium). – bilal Jan 04 '19 at 08:46

0 Answers0