3.1.2 • Published 1 month ago

@gravityforms/react-utils v3.1.2

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
1 month ago

Gravity Forms React Utils

Custom React utilities for Gravity Forms development.

Installation

Install the module

npm install @gravityforms/react-utils --save

Note: This package requires node 20.10.0 or later, and npm 10.2.3 or later.

Overview

A collection of JavaScript utilities that we use in our React. Function docs site to come.

Usage

Example:

import { create } from '@gravityforms/react-utils';

const createZustandStore = ( data ) => {
	const initialState = getConfig( config, 'gform_admin_config' ) || {};

	const storeActions = ( set ) => ( {
		closeDialog: () => set( () => ( { isOpen: false } ) ),
	} );
	
	const useStore = create( initialState, storeActions );
}

Documentation

The documentation for this package is available at http://docs.js.gravity.com/