We are Coltor Apps ― a software development agency behind this OSS. Need a reliable tech partner?

Let’s talk

React API Reference

useEntityAdded

The useEntityAdded hook calls the provided callback whenever a new entity is added to the given builder store's schema.

Reference

useEntityAdded(builderStore, callback)

import { useBuilderStore, useEntityAdded } from "@coltorapps/builder-react";

import { formBuilder } from "./form-builder";

export function App() {
  const builderStore = useBuilderStore(formBuilder);

  useEntityAdded(builderStore, (entity) => {
    console.log("Entity added:", entity);
  });

  return null;
}

Parameters

useEntityAdded accepts two parameters:

ParameterTypeDescription
builderStoreobjectThe builder store instance to monitor.
callbackfunctionA function called whenever a new entity is added. Receives the added entity.

Returns

This hook does not return a value. It registers a side effect that triggers the provided callback whenever an entity is added to the store.

Previous
useEntityAttributesErrors

Canary Branch