Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.