root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 391 forks source link

Can't find variable: ControlPanel #322

Open brije111 opened 6 years ago

brije111 commented 6 years ago

device-2017-09-19-144601

awreese commented 6 years ago

Is this one of the two demos from this repo? Your own project? Posting a red error screen without any context isn't very useful. If I had to guess, perhaps you have a missing import or a typo in the variable name (i.e. controlPanel vs. ControlPanel). If you shared some of the code then someone can see what may be happening.

awreese commented 6 years ago

@brije111 I saw some email traffic that you had posted some code, but I don't see it here... did you resolve your issue?

brije111 commented 6 years ago

screenshot from 2017-09-21 11-33-16 I tried to post code many times but when I paste the code in this box It looks good but when I submit, I get some line or part of my code not visible. Sorry for the email traffic you got. I was not aware of this that you will get new email on every comment that I've tried and deleted immediately. So now I'm posting screenshot of my code. Please have a look

awreese commented 6 years ago

Line 16: content={<ControlPanel />}

You need to either define ControlPanel as a new class in App.js, or import it in order to use it. Same goes for MainView on line 18.

FYI: In the error screen shot the stack trace shows the exception was thrown in App.js' render function on line 16, cursor position 17, so it's where you should start looking when debugging.

MAYDAY1993 commented 6 years ago

ControlPanel is not defined ,so came the error in the example, ControlPanel has already been defined, so if you want to use this component,you need to define too,or import other components you've created. ControlPanel.js,this is the file link