You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I added displayNames to the generated loadable components, so that they are identifiable in react-devtools. If this change would be acceptable, i'll convert this into a PR
Here is the diff that solved my problem:
diff --git a/node_modules/@loadable/component/dist/loadable.esm.js b/node_modules/@loadable/component/dist/loadable.esm.js
index 7f43596..80f589d 100644
--- a/node_modules/@loadable/component/dist/loadable.esm.js+++ b/node_modules/@loadable/component/dist/loadable.esm.js@@ -59,13 +59,17 @@ function resolveConstructor(ctor) {
}
var withChunkExtractor = function withChunkExtractor(Component) {
- return function (props) {+ function LoadableWithChunkExtractor(props) {
return React.createElement(Context.Consumer, null, function (extractor) {
return React.createElement(Component, Object.assign({
__chunkExtractor: extractor
}, props));
});
};
+ if (Component.displayName) {+ LoadableWithChunkExtractor.displayName = Component.displayName + 'WithChunkExtractor';+ }+ return LoadableWithChunkExtractor;
};
var identity = function identity(v) {
@@ -395,6 +399,8 @@ function createLoadable(_ref) {
}, props));
}); // In future, preload could use `<link rel="preload">`
+ Loadable.displayName = 'Loadable';+
Loadable.preload = function (props) {
ctor.requireAsync(props);
};
Hey @forivall 👋,
Thank you for opening an issue. We'll get back to you as soon as we can.
Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers.
If you use Loadable at work, you can also ask your company to sponsor us ❤️.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@loadable/[email protected]
for the project I'm working on.Basically, I added
displayName
s to the generated loadable components, so that they are identifiable in react-devtools. If this change would be acceptable, i'll convert this into a PRHere is the diff that solved my problem:
This issue body was partially generated by patch-package.
obvi, the patch is to the esm build, so my PR would be editing the source.
The text was updated successfully, but these errors were encountered: