Open redxtech opened 4 years ago
I prefer exposing a prop like shouldRender
over directly support every possible use case in this library.
Ah ok. By this do you mean a shouldRender
prop that you pass whatever expression that your prerendering library uses to signify that it is being used? If so, I can definitely see why, as I am also usually a fan of a general solution instead of numerous hard-coded solutions.
This being said, I still have a few concerns with just using a shouldRender
prop:
Perhaps including a few hard-coded options for some of the more popular libraries while also including a shouldRender
prop would be a solution that combines the best of both worlds?
I have created this PR to allow this component to function with multiple prerendering libraries. The ones I have tested so far are below:
react-snap
prerender-spa-plugin
presite
snapshotify
prerenderer
prep
I will update this PR as I hear back from the library authors. I will also happily add detection methods for other libraries as requested if I can find out how to detect that the app is being prerendered.