This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-gforms
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

react-gforms

GForms for react

NPM JavaScript Style Guide

Install

npm install --save react-gforms

Usage

import * as React from "react";
import useGForms, {GFormField} from 'react-gforms';
 
const gformActionUrl: string =
  "https://docs.google.com/forms/d/e/ab123456-ojfiMZaDVu4U1lo6T7b7XrkzIE0V4mPQfllabcdefg/formResponse";
 
const ExampleForm: React.FC = () => {
  const gforms = useGForms(gformActionUrl, () => console.log("Sent!"));
 
  return (
    <div>
      <p>My form!</p>
      <GFormField
        gforms={gforms}
        nameAttribute="emailAddress"
        render={(value: any, setValue: (val: any) => void) => {
          return (
            <input
              type="text"
              value={value}
              onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
                setValue(e.target.value);
              }}
            />
          );
        }}
      />{" "}
      <GFormField
        gforms={gforms}
        nameAttribute="entry.1234567890"
        render={(value: any, setValue: (val: any) => void) => {
          return (
            <input
              type="text"
              value={value}
              onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
                setValue(e.target.value);
              }}
            />
          );
        }}
      />
      <div>
        <button onClick={gforms.submit}>Send</button>
      </div>
    </div>
  );
};
 
export default ExampleForm;

License

ISC © justinmahar

Readme

Keywords

none

Package Sidebar

Install

npm i react-gforms

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

37.7 kB

Total Files

10

Last publish

Collaborators

  • justinmahar