Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kenjinp/react-javelin
React helpers for https://github.com/3mcd/javelin ECS
https://github.com/kenjinp/react-javelin
Last synced: about 1 month ago
JSON representation
React helpers for https://github.com/3mcd/javelin ECS
- Host: GitHub
- URL: https://github.com/kenjinp/react-javelin
- Owner: kenjinp
- Created: 2021-09-25T11:30:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-22T14:09:00.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T05:26:49.703Z (about 2 months ago)
- Language: TypeScript
- Size: 529 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# react-javelin
React helpers for [`@javelin`](https://github.com/3mcd/javelin) ECS
These are specially usefull when composing deeply nested components with something like [`@react-three/fiber`](https://github.com/pmndrs/react-three-fiber)
## Usage 👍
Use react as a declarative interface to write your game entities and components into jsx markup
[`Codesandbox: Physics & Falling Boxes Example`](https://codesandbox.io/s/react-javelin-example-76071?file=/src/App.tsx)
```typescript
export default function App() {
return (
{({ entityId }) => }
);
}
```## Includes 🔋
- [**Components**](./src/components)
- `Monitor` — render an array components matching a query.
- [**Providers**](./src/providers)
- `WorldProvider` — create your ecs "world" instance
- `EntityProvider` — reference a specific entity, useful for deeply nested components- [**Hooks**](./src/hooks)
- `useWorld` — access the world from anywhere in the app, via the `WorldProvider`
- `useTopic` — add a Topic to the world
- `useSystem` — drop in a system
- `useMonitor` — provides a list of entities that matches a query
- `useEntity` — returns an entity from the `EntityProvider`