Skip to content

Commit 2ee1e61

Browse files
committed
Update README with forms refactoring
1 parent 4cc52dd commit 2ee1e61

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function App() {
4646
| **Roadmap** | `RoadmapBoard` | `useRoadmap` |
4747
| **Changelog/Releases** | `Releases`, `ReleaseList`, `ReleaseDetail` | `useReleases`, `useRelease` |
4848
| **Help Center** | `HelpCenter`, `HelpFlowCard`, `HelpFlowDetail`, `HelpArticleCard`, `HelpArticleDetail` | `useHelpCenter`, `useHelpFlow`, `useHelpArticle` |
49-
| **Support** | `SupportForm`, `ContactFormRenderer` | `useSupport`, `useContactForm`, `useContactFormSubmit` |
49+
| **Support** | `SupportForm`, `FormRenderer` | `useSupport`, `useForm`, `useFormSubmit` |
5050
| **Surveys** | `SurveyForm` | `useSurvey`, `useSurveySubmit` |
5151
| **Blog** | `Blog`, `BlogList`, `BlogCard`, `BlogPostDetail` | `useBlogPosts`, `useBlogPost`, `useBlogCategories`, `useFeaturedPosts` |
5252
| **Status Page** | `StatusBoard` | `useStatus` |
@@ -241,16 +241,15 @@ import { SupportForm } from '@appgram/react-native'
241241
/>
242242
```
243243

244-
#### ContactFormRenderer
244+
#### FormRenderer
245245

246-
Render dynamic contact forms.
246+
Render dynamic forms.
247247

248248
```tsx
249-
import { ContactFormRenderer } from '@appgram/react-native'
249+
import { FormRenderer } from '@appgram/react-native'
250250

251-
<ContactFormRenderer
251+
<FormRenderer
252252
formId="contact-sales"
253-
userEmail="user@example.com"
254253
onSuccess={() => console.log('Submitted!')}
255254
/>
256255
```
@@ -440,17 +439,17 @@ await submitTicket({
440439
})
441440
```
442441

443-
### useContactForm / useContactFormSubmit
442+
### useForm / useFormSubmit
444443

445-
Fetch and submit dynamic contact forms.
444+
Fetch and submit dynamic forms.
446445

447446
```tsx
448-
import { useContactForm, useContactFormSubmit } from '@appgram/react-native'
447+
import { useForm, useFormSubmit } from '@appgram/react-native'
449448

450-
const { form, isLoading } = useContactForm('form-id')
451-
const { submitForm, isSubmitting, error } = useContactFormSubmit()
449+
const { form, isLoading } = useForm('form-id')
450+
const { submitForm, isSubmitting, error } = useFormSubmit()
452451

453-
await submitForm('form-id', { name: 'John', email: 'john@example.com', message: 'Hello!' })
452+
await submitForm(projectId, 'form-id', { name: 'John', email: 'john@example.com', message: 'Hello!' })
454453
```
455454

456455
### useSurvey / useSurveySubmit

0 commit comments

Comments
 (0)