I have a component I am trying to simplify. I am removing some functions from the file to put into another folder to help make the code more readable.
this is an example of one of the functions I'm moving,
export default function generatemwapGraphData(items) {
let total = {
mwap: 0,
.. };
let count = items.length;
items.forEach((item) => {
total["mwap"] += item["mwap"] / count;
...
});
let finalData = [];
Object.keys(total).forEach((exp) => {
finalData.push({
expression: exp,
Percentage: +(total[exp] * 100).toFixed(2),
});
});
return finalData;
}
Now when I take this function and try to import it like this,
import generateExpressionsGraphData from "components/dashboard/Mood/functions/generateExpressionsGraphData"
It returns an error of
Attempted import error: 'generateExpressionsGraphData' is not exported from 'components/dashboard/Mood/functions/generateExpressionsGraphData' (imported as 'generateExpressionsGraphData').
Surely this should be fine?
Thanks
generatemwapGraphDataorgenerateExpressionsGraphData