Skip to content

Commit

Permalink
perf: enable tree-shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
theoludwig committed May 13, 2023
1 parent ef56353 commit da5d468
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Please first discuss the change you wish to make via issue before making a change. It might avoid a waste of your time. -->

## What changes this PR introduce?
# What changes this PR introduce?

## List any relevant issue numbers

Expand Down
6 changes: 4 additions & 2 deletions example/components/FormExample.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { Form, useForm } from 'react-component-form'
import type { HandleUseFormCallback } from 'react-component-form'
import useTranslation from 'next-translate/useTranslation'
Expand All @@ -8,7 +10,7 @@ import { useFormTranslation } from '../hooks/useFormTranslation'
import { userSchema } from '../models/User'
import { FormState } from './design/FormState'

const simulateServerRequest = async (ms: number): Promise<void> => {
const fakeServerRequest = async (ms: number): Promise<void> => {
return await new Promise((resolve) => {
setTimeout(resolve, ms)
})
Expand All @@ -23,7 +25,7 @@ export const FormExample: React.FC = () => {
formData,
formElement
) => {
await simulateServerRequest(2_000)
await fakeServerRequest(2_000)
console.log('onSubmit:', formData)
formElement.reset()
return {
Expand Down
Loading

1 comment on commit da5d468

@vercel
Copy link

@vercel vercel bot commented on da5d468 May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.