@jswork/service-react-route
v1.0.21
Published
React router route service.
Readme
service-react-route
React router route service..
installation
npm install @jswork/service-react-routeusage
import React from 'react';
import ServiceReactRoute from '@jswork/service-react-route';
import { routes } from '@/shared/routes';
export class App extends React.Component {
private routerRef: React.Ref<Router> = React.createRef();
componentDidMount() {
nx.$route = ServiceReactRoute.getInstance({ context: this.routerRef });
}
render() {
return <Router ref={this.routerRef}>{renderRoutes(routes)}</Router>
}
}documentation
- https://afeiship.github.io/service-react-route/
license
Code released under the MIT license.
