Skip to content

Commit a66cb9c

Browse files
committed
Removed the requirement for API token
1 parent 7c3a483 commit a66cb9c

File tree

4 files changed

+19
-40
lines changed

4 files changed

+19
-40
lines changed

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BrowserRouter, Routes, Route } from 'react-router-dom';
22
import ManagedForm from './examples/fetchForm/ManagedForm';
3-
import CustomForm from './examples/customForm/Parent';
3+
import CustomForm from './examples/customForm/CustomFetchForm';
44
import Layout from './examples/components/Layout';
55

66
function App() {

src/examples/customForm/CustomFetchForm.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import './antDesignStyles.css';
1414

1515
const CustomFetchForm = () => {
16-
// FetchFormProvider needs to wrap this component
1716
const [fetchForm, loading, error, doCloudSubmit] = useFetchForms(
1817
process.env.REACT_APP_FF_FORM_ID
1918
);

src/examples/customForm/Parent.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/examples/fetchForm/ManagedForm.js

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { FetchForm, FetchFormsProvider } from '@fetchforms/react';
2+
import { FetchForm } from '@fetchforms/react';
33

44
const ManagedForm = () => {
55
const [formSubmission, setFormSubmission] = useState(null);
@@ -11,29 +11,24 @@ const ManagedForm = () => {
1111
};
1212
return (
1313
<div className=''>
14-
<FetchFormsProvider permission={process.env.REACT_APP_FF_TOKEN}>
15-
<div className='text-3xl mb-2'>Managed Form</div>
16-
<p className='text-gray-600'>
17-
The easiest way to use Fetch Forms. Pass in a form slug and we'll
18-
handle client-side validation, input formatting, submissions, and
19-
styling.
20-
<br />
21-
When submitted, the data will be passed to your component after it's
22-
formatted and saved to the Fetch Forms cloud (only if cloudSave is
23-
enabled).
24-
</p>
14+
<div className='text-3xl mb-2'>Managed Form</div>
15+
<p className='text-gray-600'>
16+
The easiest way to use Fetch Forms. Pass in a form slug and we'll handle
17+
client-side validation, input formatting, submissions, and styling.
2518
<br />
26-
<div>
27-
<FetchForm
28-
slug={process.env.REACT_APP_FF_FORM_ID}
29-
onSubmit={onSubmit}
30-
/>
31-
<br />
32-
{formSubmission && (
33-
<pre>{JSON.stringify(formSubmission, null, 2)}</pre>
34-
)}
35-
</div>
36-
</FetchFormsProvider>
19+
When submitted, the data will be passed to your component after it's
20+
formatted and saved to the Fetch Forms cloud (only if cloudSave is
21+
enabled).
22+
</p>
23+
<br />
24+
<div>
25+
<FetchForm
26+
slug={process.env.REACT_APP_FF_FORM_ID}
27+
onSubmit={onSubmit}
28+
/>
29+
<br />
30+
{formSubmission && <pre>{JSON.stringify(formSubmission, null, 2)}</pre>}
31+
</div>
3732
</div>
3833
);
3934
};

0 commit comments

Comments
 (0)