@mud-classic/react
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

MUD React

React hooks (and more) for building MUD clients.

useComponentValue

Returns the value of the component for the entity, and triggers a re-render as the component is added/removed/updated.

const position = useComponentValue(Position, entity);

useEntityQuery

Returns all matching EntityIndexes for a given entity query, and triggers a re-render as new query results come in.

const entities = useEntityQuery([Has(Position)]);
const playersAtPosition = useEntityQuery([Has(Player), HasValue(Position, { x: 0, y: 0 })]);

/@mud-classic/react/

    Package Sidebar

    Install

    npm i @mud-classic/react

    Weekly Downloads

    0

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    7.31 MB

    Total Files

    34

    Last publish

    Collaborators

    • darrylyeo
    • jiracheron