How to import from a multiple class exported js
file in react-loadable
.
I am trying to import CustomButton
from MyButton.js
using react-loadable
in Home.js
. This is the only way I know to do it, is not working.
MyButton.js
import {
CustomButton,
BUTTON_STYLE,
BUTTON_TYPE,
BUTTON_SIZE,
BUTTON_ALIGN,
COLOR
} from './buttons';
module.exports = {
CustomButton,
BUTTON_STYLE,
BUTTON_TYPE,
BUTTON_SIZE,
BUTTON_ALIGN,
COLOR
}
Home.js
const AsyncButton = Loadable({
loader: () => import('../../button/MyButton'),
loading: Loading
});
Please help. Thanks in advance.