Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vilicvane/routra
Just another state router with transition support.
https://github.com/vilicvane/routra
react-router router
Last synced: 20 days ago
JSON representation
Just another state router with transition support.
- Host: GitHub
- URL: https://github.com/vilicvane/routra
- Owner: vilicvane
- License: mit
- Created: 2022-08-10T22:28:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T10:43:30.000Z (10 months ago)
- Last Synced: 2024-11-30T15:41:59.970Z (23 days ago)
- Topics: react-router, router
- Language: TypeScript
- Homepage:
- Size: 593 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Routra
Just another state router with transition support.
## Installation
```bash
npm install routra routra-react
```## Usage
```tsx
import {routra} from 'routra';
import {Route} from 'routra-react';const router = routra({
user: {
profile: true,
settings: true,
},
});const App = () => {
return (
<>
>
);
};
``````tsx
import classNames from 'classnames';
import {useEffect} from 'react';
import styled from 'styled-components';const View = styled.div`
&.entering {
animation: ...;
}&.leaving {
animation: ...;
}
`;const UserProfileView = ({view, transition}) => {
useEffect(() => {
view.$transition({
entering: true,
leaving: true,
});
}, [view]);return (
...
);
};
```## License
MIT License.