Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@umbraco/headless-forms-react

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@umbraco/headless-forms-react

Umbraco Forms React Components for Umbraco Heartcore

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Umbraco Forms React Components for Umbraco Heartcore

Install

> npm install --save @umbraco/headless-forms-react

Usage

// src/app.ts
import React, { useEffect, useState } from 'react'
import { Form, FormData, UmbracoForm } from '@umbraco/headless-forms-react'

// import the default styles
import "@umbraco/headless-forms-react/themes/default.css"

const App: React.FC = () => {
  const [form, setForm] = useState<UmbracoForm>()
  useEffect(() => {
    const loadForm = async () => {
      const result = ... // fetch from server
      setForm(result)
    }

    loadForm()
  }, [])

  const handleSubmit = async (data: FormData) => {
    // handle submitted data
  }

  return (
    <div className="App">
      <Form
        form={form}
        onSubmit={handleSubmit}
      />
    </div>
  )
}

export default App

reCAPTCHA

To use the reCAPTCHA v2 field you need to pass your public site key to the Forms component.

const App: React.FC = () => {
  return (
    <div className="App">
      <Form
        form={form}
        recaptchaPublicKey="my-site-key"
     />
    </div>
  )
}

Keywords

FAQs

Package last updated on 16 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc