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

Let’s talk

React API Reference

useBuilderStore

This React hook creates a builder store.

Reference

useBuilderStore(builder, options?)

Use the useBuilderStore function to create a builder store.

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

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

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

Parameters

useBuilderStore accepts two parameters:

ParameterTypeDescription
builderobjectThe builder definition.
optionsobject optionalAn optional partial object with initialization options.

You should know!

Ensure that the provided builder parameter remains stable or is memoized. The builder store will be recreated if the builder reference changes, leading to data loss.

Options

The options parameter properties:

PropertyTypeDescription
initialDataobject optionalThe optional partial initial data of the builder store.

Returns

The useBuilderStore function essentially creates and returns a builder store.

Previous
EntityAttributesValues

Canary Branch