3 ms·
is there a way for React to do eager loading? i asked around on twitter but got told "thats not React's job".
by swyx 9y ago
is there a way for React to do eager loading? i asked around on twitter but got told "thats not React's job".
- throwaway284534 9y agoLoading of modules can be managed by Webpack's chunk configuration. Each import declaration can be turned into a promise that executes your code when all dependencies are fetched.
- connorelsea 9y agoI think the react dev team is currently working on an official async loading pattern for a future update. But currently webpack, rollup, etc. offer dynamic import, code-splitting, tree-shaking
- shados 9y agoNot sure if that's what you mean, but when Andrew Clark keeps mentioning the "async" word, he means async rendering, not async loading.
- connorelsea 9y agoWhat is an unsolved async loading problem in React you are experiencing?
- shados 9y agoI don't have any issues with async loading. I'm just saying that I believe what you are referring to when you say the React team is working on an official async pattern is not actually async loading, but async rendering. At least every time one of their members said the word async in the last couple of weeks/months, it's what they referred to, and it's a completely different (and unrelated) thing. I can't read your mind though, so I'm just guessing.