twobin / twobin/react-lazyload

Add API for either a `render` prop or renderprops

Open
#222 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
485
PR merge metrics
No merged PRs in 30d

Description

By conditionally rendering `children`, this library already-constructed instances of components and chooses whether to render them or not. This works for most use cases, but there are some libraries that do expensive or interesting work before mount. There's a discussion to be had about whether it's a good idea on the part of those libraries, but I want to take that as a given.

Adding a `render` prop that only executes if the lazyload conditions are met would sidestep this issue. It would also be slightly more efficient, again because the component instances wouldn't be created until the render function is executed.

Thoughts? I'm willing to do the work to add this feature.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.