irychen / keepalive-for-react

React KeepAlive is a component that can cache the state of the component and reuse it when needed.
MIT License
199 stars 35 forks source link

add: Enabling mount points to be passed from props #15

Closed j-sakamoto closed 3 months ago

j-sakamoto commented 3 months ago

Hi, I wanted to use this repository as a migration from React-router v5, but the two-level deep DOM hierarchy of cached nodes made it difficult to achieve ideal styling of the nodes.

This problem was solved by allowing refs to be passed in props.

I also thought it would be better to be able to give cached nodes their own class name, so i did so.