Reputation: 61
I have compiled the below code it's getting me the Parsing error: Unexpected token, expected "..." Error Don't know why.
import React,{Component} from 'react';
import EditableContetnt from './Fuck';
import Mymenu from './Mymenu';
import 'react-contexify/dist/ReactContexify.min.css';
import { MenuProvider } from 'react-contexify';
class App extends Component
{
constructor()
{
super();
this.state={name:'Hello World'};
}
render()
{
const {name}=this.state;
console.log(name);
return(
<div>
<MenuProvider id="menu_id">
<EditableContetnt {name}/>
</MenuProvider>
<Mymenu/>
</div>
)
}
}
export default App;
when i run the module it shows Parsing error: Unexpected token, expected "..."
Upvotes: 0
Views: 319
Reputation: 173
try to change: import 'react-contexify/dist/ReactContexify.min.css';
to
import './react-contexify/dist/ReactContexify.min.css';
(if it's in the same directory)
Upvotes: 0
Reputation: 2750
Try to pass your name
variable to MenuProvider
component different way. Like this:
<EditableContetnt name={name} />
Upvotes: 3