I have the following code:
import * as apple from './Apple.json';
import * as orange from "./Orange.json";
import * as pear from "./Pear.json";
export default {
Apple,
Orange,
Pear
}
I am using the entries inside of 'export default' to create Hyperlinks on a new page, However, i would like to export as 2 words for each line.
export default {
Blue Apple,
Red Orange,
Black Pear
}
The problem is, this breaks my application and the project won't start. I have tried to add "" eg. "Blue Apple". But this will not work.
How can i achieve this?
Would something like this solve your issue?
export default {
'Blue Apple': 'Blue Apple',
'Red Orange': 'Red Orange',
'Black Pear': 'Black Pear'
}
Or just export an array of the string values
export default ['Blue Apple', 'Red Orange', 'Black Pear']