Skip to content

Commit f42d408

Browse files
committed
docs: fix usage example import and export
1 parent 643722d commit f42d408

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

www/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ yarn add react-netlify-forms
4343
In the following example a contact form with two inputs and a honeypot for extra spam prevention is shown. It also works without JavaScript by falling back to a serverside-rendered form which just submits data with an usual POST request:
4444

4545
```jsx
46-
import React, { Component } from 'react'
47-
46+
import React from 'react'
4847
import { NetlifyForm, Honeypot } from 'react-netlify-forms'
4948

50-
export default ContactForm = () => (
49+
const ContactForm = () => (
5150
<NetlifyForm name='Contact' action='/thanks' honeypotName='bot-field'>
5251
{({ handleChange, success, error }) => (
5352
<>
@@ -77,6 +76,8 @@ export default ContactForm = () => (
7776
)}
7877
</NetlifyForm>
7978
)
79+
80+
export default ContactForm
8081
```
8182

8283
For more examples please browse through our website.

0 commit comments

Comments
 (0)