React API Reference

useEntitiesValues

This React hook retrieves the values of all entities or the selected ones within the context of an interpreter store. It should be used within the hierarchy of <Interpreter /> to access its context. Typically, you'll use it inside entities components.

Reference

useEntitiesValues(entitiesIds?)

Use the useEntitiesValues function to retrieve the values of all entities or the selected ones.

import {
  createEntityComponent,
  useEntitiesValues,
} from "@coltorapps/builder-react";

import { textFieldEntity } from "./text-field-entity";

export const TextFieldEntity = createEntityComponent(
  textFieldEntity,
  (props) => {
    const entitiesValues = useEntitiesValues();
  },
);

Parameters

useEntitiesValues accepts a single parameter:

ParameterTypeDescription
entitiesIdsarrayAn optional array of entity IDs to retrieve the values of.

Returns

The useEntitiesValues function essentially returns an object containing the values of all entities or the selected ones.

Previous
<Interpreter />