# react-gforms

> GForms for react

Latest version **1.0.3** (published 2019-06-06) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-gforms
pnpm add react-gforms
yarn add react-gforms
bun add react-gforms
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-06-06 |
| First published | 2019-06-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 36.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | justinmahar |
| Maintainers | justinmahar |

## Links

- npm: https://www.npmjs.com/package/react-gforms
- Repository: https://github.com/justinmahar/react-gforms
- Homepage: https://github.com/justinmahar/react-gforms#readme
- Issues: https://github.com/justinmahar/react-gforms/issues
- npm.io page: https://npm.io/package/react-gforms

## Dependencies (1)

- [react-scripts](https://npm.io/package/react-scripts.md) ^3.0.1

## Recent versions

- 1.0.3 (latest) — 2019-06-06
- 1.0.2 — 2019-06-06
- 1.0.1 — 2019-06-06
- 1.0.0 — 2019-06-06

## README

# react-gforms

> GForms for react

[![NPM](https://img.shields.io/npm/v/react-gforms.svg)](https://www.npmjs.com/package/react-gforms) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-gforms
```

## Usage

```tsx
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](https://github.com/justinmahar)

---
_Source: https://npm.io/package/react-gforms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
