How to use the informed.useFieldApi 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 adobe / aem-core-cif-components / react-components / src / components / App / paymentProviders / braintree.js View on Github external
const Braintree = props => {
    const [{ braintreeToken }, dispatch] = useCheckoutState();
    const [{ cart }, cartDispatch] = useCartState();

    const [dropinInstance, setDropinInstance] = useState(); // This state is gone after you leave the payment form
    const [paymentMethodRequestable, setPaymentMethodRequestable] = useState(false);
    const paymentNonceField = useFieldApi('payment_nonce');

    const [createBraintreeClientToken, { data: braintreeTokenData, error: braintreeTokenError }] = useMutation(
        CREATE_BRAINTREE_CLIENT_TOKEN
    );

    async function createDropinInstance() {
        try {
            // Tear down instance if it already exists, e.g. when switching between the PayPal and credit card form.
            if (dropinInstance) {
                await dropinInstance.teardown();
                setDropinInstance(false);
            }

            let paypal = false;
            if (props.accept === 'paypal') {
                const amount = {
github LN-Zap / zap-desktop / renderer / components / Onboarding / Steps / components / SeedWordInput.js View on Github external
const SeedWordInput = ({ index, onPaste, placeholder, setFormApiFieldValue }) => {
  const inputKey = `word${index}`
  const fieldApi = useFieldApi(inputKey)
  const [measuredRef, maxHeight] = useMaxScreenHeight(300)
  const height = Math.max(maxHeight, 100)

  /**
   * mask - Masks the value with a trimmed version.
   *
   * @param {string} value Value to check
   * @returns {string} Trimmed string
   */
  const mask = value => (value ? value.trim() : value)

  /**
   * validate - Check if a word is included in the bip39 word list.
   *
   * @param {string} value Value to check
   * @returns {string|undefined} undefined if word is in bip39 word list. The string 'incorrect' otherwise

informed

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

MIT
Latest version published 1 month ago

Package Health Score

75 / 100
Full package analysis