I have found a solution that worked for me.
These are the steps:
-
Turn the json file to a JavaScript file (i.e. Change the file extension from .json to .js).
-
Export the data (export const data = [‘this will be your objects’])
-
Add require and default to the image property ({image: require(‘Your image path’).default}).
-
Lastly, import the data file into the file you want to use it.