Route based code splitting with react and redux
Multi tool use
up vote
0
down vote
favorite
Looking at the React doc, I implemented the route-based code splitting part in my application.
But I get an error:
TypeError: Object(...) is not a function
It seems it's coming from Redux that doesn't support function passed as components arguments and crashes when we import components with the lazy()
function just like I do in my code:
const Login = lazy(() => import("../../containers/Login/Login"))
Do you have any workaround solution? I found react-loadable but that's not exactly what I want to implement.
javascript reactjs redux code-splitting
add a comment |
up vote
0
down vote
favorite
Looking at the React doc, I implemented the route-based code splitting part in my application.
But I get an error:
TypeError: Object(...) is not a function
It seems it's coming from Redux that doesn't support function passed as components arguments and crashes when we import components with the lazy()
function just like I do in my code:
const Login = lazy(() => import("../../containers/Login/Login"))
Do you have any workaround solution? I found react-loadable but that's not exactly what I want to implement.
javascript reactjs redux code-splitting
Are you exporting theLogin
component withexport default ...
?
– Tholle
2 days ago
1
Yes I am.export default withStyles(styles)(component)
– Alex Mas
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Looking at the React doc, I implemented the route-based code splitting part in my application.
But I get an error:
TypeError: Object(...) is not a function
It seems it's coming from Redux that doesn't support function passed as components arguments and crashes when we import components with the lazy()
function just like I do in my code:
const Login = lazy(() => import("../../containers/Login/Login"))
Do you have any workaround solution? I found react-loadable but that's not exactly what I want to implement.
javascript reactjs redux code-splitting
Looking at the React doc, I implemented the route-based code splitting part in my application.
But I get an error:
TypeError: Object(...) is not a function
It seems it's coming from Redux that doesn't support function passed as components arguments and crashes when we import components with the lazy()
function just like I do in my code:
const Login = lazy(() => import("../../containers/Login/Login"))
Do you have any workaround solution? I found react-loadable but that's not exactly what I want to implement.
javascript reactjs redux code-splitting
javascript reactjs redux code-splitting
edited 2 days ago
asked Nov 12 at 16:16
Alex Mas
566
566
Are you exporting theLogin
component withexport default ...
?
– Tholle
2 days ago
1
Yes I am.export default withStyles(styles)(component)
– Alex Mas
2 days ago
add a comment |
Are you exporting theLogin
component withexport default ...
?
– Tholle
2 days ago
1
Yes I am.export default withStyles(styles)(component)
– Alex Mas
2 days ago
Are you exporting the
Login
component with export default ...
?– Tholle
2 days ago
Are you exporting the
Login
component with export default ...
?– Tholle
2 days ago
1
1
Yes I am.
export default withStyles(styles)(component)
– Alex Mas
2 days ago
Yes I am.
export default withStyles(styles)(component)
– Alex Mas
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266120%2froute-based-code-splitting-with-react-and-redux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
O2zPKbv1kKvFQ 7 TllUBzX0d,m8o HRgV,LeVTSwpflzGoI2v Au4vPGYbYOuDaF,HKQeIsk6Y5kuS,lsIiHEZawLZ2YAJJLMhL 2aYVm7
Are you exporting the
Login
component withexport default ...
?– Tholle
2 days ago
1
Yes I am.
export default withStyles(styles)(component)
– Alex Mas
2 days ago