Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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`