'import name from' is the right way to import json and css files in react project.
Yesterday someone complains hostconf doesn't work when they are using adaptivecards-react. After the investigation, the root cause is that she import the json file like below:
import * as dark from "./dark.json"
But actually it should be
import dark from "./dark.json"
Here is the why:
- Importing an entire module:
import * as name from 'module-name'
- Import default export from a module:
import name from 'module-name'