I have a constant like below that I am using inside a react functional component -
const superHeroPowers = [
{ name: 'Superman', status: superManPowerList },
{ name: 'Batman', status: batmanPowerList },
{ name: 'Wonder Woman', status: wonderWomanPowerList }
];
Here, the values of the status property are coming from the state local to the component. Now, I would like to use this constant in another component while routing. How can I achieve this? I have tried to export the constant but modifiers are not allowed inside a React component. Also, I tried to declare this constant outside the component, but then it will not be able to pick up the local state in status. I can't pass it as props because I am using the next router to navigate.