When I use a custom loader I receive this error:
Failed prop type: Invalid prop loading supplied to Document, expected a ReactNode.
this is my code:
const renderLoader = () => (
<div className={isDesktop() ? 'container-centered-desktop' : 'container-centered-mobile'} >
<div className="loader"></div>
</div>
);
<Document
loading={renderLoader}
...
>
Anyone Can help me?
I am currently having the same error on my console when I add a custom render function for the loader!
Any ideas on what could be causing this issue?
Holy crap, 3 years of development and no one ever noticed it :D Fixing right away. Will be available in next v5 beta or stable release.
Lol! Literally just tried loading for the first time in years of having it in our project and looked this up. What a crazy thing.
Per the docs can we expect it to take Strings and Functions alike (assuming they will return jsx markup)?
Yes, any valid node or a function returning one will do.
Note: This fix was cherry-picked to v4.2.0 release.
Most helpful comment
Holy crap, 3 years of development and no one ever noticed it :D Fixing right away. Will be available in next v5 beta or stable release.