Reputation: 665
I have a variable like this:
export var navigation = [
];
Import variable for use:
import { navigation } from 'app/navigation/navigation';
But when I want to use this variable a have the next error:
Upvotes: 1
Views: 3186
Reputation: 96
You cannot assign data to exported values. They are read-only. When you import { navigation } from 'app/navigation/navigation';
you cannot assign any value to navigation. You can only use it to display/use some data. If you want to assign value to the navigator
use other approach, eg. use service.
Upvotes: 4
Reputation: 9658
var navigation = [];
export default navigation;
and then :
import navigation from 'app/navigation/navigation';
Upvotes: 1