
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
react-keeper
Advanced tools
A routing library of React, but more than router.
React-Router is a great product, we learned a lot from it. But we truely faced many problems that React-Router doesn't resolve in real using, especially in mobile APPs.
We did a lot to let React-Keeper fit mobile APPs, such as Pages Cache
, Extensible Route
, Route Filters
and so on.
We create a lot of flexible ways, so you can config the router more simplely.
And more...
Keeper V2.1 had published !!!
Keeper V2.0 had published !!!
Route Component -
( How to config the Route
component )
Link Component -
( How to use Link
component)
CacheLink Component -
( How to use CahceLink
component )
RouteMapping -
( How to config path
of route )
Filter -
( How to use filters
)
Page Cache -
( How to cache
pages )
Control -
( Use Router Control
in JavaScript code. )
Browser -
( Use React-Keeper in browser. )
npm install react-keeper
Don't use cnpm.
You can add route components anywhere,anytime.
const App = ()=> {
return (
<HashRouter>
<div>
<Route cache component={ Home } path="/"/>
<Route component={ Products } path="/products"/>
</div>
</HashRouter>
)
}
const Products = ()=> {
return (
<div>
<Route component={ ScienceProducts } path="/sci" />
<Route component={ DailiUseProducts } path="/dai" />
</div>
)
}
ReactDOM.render(<App/>, document.getElementById('root'))
Cache pages' state while not matched, and recover them when matched. Certainly you can config which one to cache.
cache
tag to cache a page.CacheLink
Component to hold a will-unmount's page when open a new page. <Route cache component={Home} path='/'/>
<CacheLink to='/product/ASDFADF'>Detail</CacheLink>
Load a component dynamicly when it's route matches, such as:
<Route loadComponent={ (callback)=>{
import('../Products.js').then((Products)=>{
callback(Products)
})
} } path='/products'/>
Enter filters
, filters run before a route mount succeed, such as : login's check.Leave filters
, filters run before a route unmount succeed, such as : unsubmited form data.<HashRouter>
<Route path='/user' component={User}, enterFilter={[ loginFilter, (cb, props)=>{ if(props.access) cb()} ] } />
</HashRouter>
index
tag : Index page of a module.miss
tag : When miss match.cache
tag : Cache a page for preventing to unmount after it mounted.<HashRouter>
<div>
<Route cache component={ Home } path="/"/>
<Route component={ Products } path="/products" enterFilter={ loginFilter }>
<Route index component={Enterprise} path="/ep"/>
<Route miss component={ NotFound }/>
<Route component={ Detail } path="/item/:id" time={new Date().toLocaleString()}/>
</Route>
<Route component={ Home } path="/products">
<Route index component={ ProductNav }/>
</Route>
</div>
</HashRouter>
Supports rendering in server side
Memory of scroll position
Remember the scroll positions of every page, for scrolling to same position when back to a page.
App.js
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { HashRouter, Route } from 'react-keeper'
import User from './User'
// other import
class App extends Component {
render(){
return (
<HashRouter>
<div>
<Route cache component={ Home } path="/"/>
<Route component={ Products } path="/products" enterFilter={ loginFilter }>
<Route index component={Enterprise} path="/ep"/>
<Route miss component={ NotFound }/>
<Route component={ Detail } path="/item/:id" time={new Date().toLocaleString()}/>
</Route>
<Route component={ User } path="/user"/>
</div>
</HashRouter>
)
}
}
ReactDOM.render(<App/>, document.getElementById('root'))
User.js
import React, { Component } from 'react'
import { Link, Route } from 'react-keeper'
// other import
export default class User extends Component {
render(){
return (
<div>
<ul>
<Link to='/info'>Info</Link>
<Link to='/edit'>Edit</Link>
</ul>
<div>
<Route index component={ UserInfo } path='/info'/>
<Route component={ UserInfoEdit } path='/edit'/>
</div>
</div>
)
}
}
With your donation, we can do it better.
git clone git@github.com:lanistor/react-keeper.git
cd react-keeper
npm install
npm run start
Then open http://127.0.0.1:8600
FAQs
A Strong Routing Library of React
The npm package react-keeper receives a total of 11 weekly downloads. As such, react-keeper popularity was classified as not popular.
We found that react-keeper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.