Skip to content

React keep alive route implemented by css display none

License

Notifications You must be signed in to change notification settings

AielloChan/KeepAliveRoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

KeepAliveRoute

React keep alive route implemented by css display none

Use

import KeepAliveRoute from '../components/KeepAliveRoute'


const App: React.FC = () => {
  return (
    <div className="App">
      <Route path="/home" component={Welcome} exact />
      <KeepAliveRoute path="/search" component={Search} keepAlive />
      <Route path="/edit" component={Label} />
    </div>
  )
}

export default App

Now, assume you searched something in "/search" page, and go to "/edit" page to edit some records, when you go back to "/search" page, your search result will still there( waitting for u 🙃.

About

React keep alive route implemented by css display none

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published