Dynamic import base on props name in react
import { a, b, c } from 'some-package/theme' // should not import everything here
const MyComp = ({ theme, ...other }) => {
console.log(theme) //can be a, b, c, d, e etc
return(<MyCompInner />)
}
export default MyComp
How can I do dynamic import from 'some-package/theme' ? the prop of theme can be a, b, c and more. Theme props is the option, but I have to import the value from 'some-package/theme' before I supply it to <MyCompInner />