How to use the informed.useFormApi function in informed

To help you get started, we’ve selected a few informed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jordaneisenburger / fallback-studio / src / pwa-studio / packages / venia-concept / src / components / SearchBar / searchField.js View on Github external
const SearchField = props => {
    const { location, onChange, onFocus } = props;
    const { value } = useFieldState('search_query');
    const formApi = useFormApi();

    const setValue = useCallback(
        queryValue => {
            // update search field
            if (queryValue) {
                formApi.setValue('search_query', queryValue);
            }

            // trigger the effects of clearing the field
            if (typeof onChange === 'function') {
                onChange('');
            }
        },
        [formApi, onChange]
    );
github LN-Zap / zap-desktop / renderer / components / Settings / SettingsPage.js View on Github external
const SettingsActionBarButtons = () => {
  const formState = useFormState()
  const formApi = useFormApi()
  return (
    <>
      <button type="button">
        
      </button>

      <button> 0 &amp;&amp; formState.invalid}
        type="submit"
        variant="normal"
      &gt;
        
      </button>
    
  )

informed

A lightweight framework and utility for building powerful forms in React applications

MIT
Latest version published 2 days ago

Package Health Score

81 / 100
Full package analysis