Lazy to support non defaults #1030
darklight9811
started this conversation in
Ideas
Replies: 1 comment
-
Came here to share the exact same thing after going through the lazy loader source. By no means a priority fix needed but would be a nice QoL improvement to make allow for lazy loading tree-shaken imports and to not have to remap it to Current// App.tsx
import { lazy } from "solid-js"
const MyLazyComponent = lazy(() => import('./MyLazyComponent').then(({ MyLazyComponent }) => ({
default: MyLazyComponent
}))) Improved// App.tsx
import { lazy } from "solid-js"
const MyLazyComponent = lazy(() => import('./MyLazyComponent').then(({ MyLazyComponent }) => MyLazyComponent)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Solidjs lazy method forces a default return from the import, maybe support default and if not found, fallback to export "root".
Something like:
I didn't have time to read the actual lazy implementation, is just to illustrate what I mean. But why? I'm using solid-icons and I have to construct an object just to pass it back by default, like this:
Beta Was this translation helpful? Give feedback.
All reactions