stratiformltd / react-loadable-visibility

A wrapper around react-loadable and @loadable/component to load elements once they are visible on the page.
BSD 3-Clause "New" or "Revised" License
1.01k stars 31 forks source link

Enable setting minHeight and minWidth on placeholder div #21

Open TheodorTomas opened 5 years ago

TheodorTomas commented 5 years ago

Do you want to request a feature or report a bug? feature

What is the current behaviour?

Defaults to 1px for minWidth and minHeight.

Desired behaviour

It would be a nice feature to be able to set the minWidth and minHeight by sending in arguments. Using a className does not suffice in all use cases.

I would be happy to contribute to this feature if this is something you would like to add to the library.

tazsingh commented 5 years ago

Thanks for the recommendation!

Per my suggestion here: https://github.com/stratiformltd/react-loadable-visibility/pull/17#issuecomment-445846881

Do you think this could be added as a global option? Or in a more fine-grained per-loadable approach?

Also could you kindly elaborate as to how the className doesn't fit the use case such that I can understand it better? My understanding is that the className could work with a fine-grained per-loadable approach but may be annoying to pass in every time if you want it for a global use case?

Much appreciated.