@formspree/react@2.5.0
·
12 commits
to main
since this release
Minor Changes
-
4c40e1b: # Fix types in @formspree/core
@formspree/core
- fix
SubmissionData
has a type ofany
causing everything after it to opt-out typechecking - remove a no-op
teardown
method onClient
andSession
- remove
utils.now
and useDate.now
instead - remove unused functions from
utils
module:append
,toCamel
,camelizeTopKeys
- add tests for
utils.appendExtraData
and convert the test file to typescript - add tests for
session.data()
- no longer export
Session
type
@formspree/react
- update types as a result of
SubmissionData
is no longerany
- fix
createPaymentMethod
does not properly map payload when the submission data is a type ofFormData
- fix the
Client
is not updated when project changes
- fix
-
49730d9: ## Improve error handling
@formspree/core
submitForm
function now will never rejects but always produces a type ofSubmissionResult
, different types of the result can be refined/narrowed down using the fieldkind
.- Provide
SubmissionErrorResult
which can be used to get an array of form errors and/or field errors (by field name) Response
is no longer made available on the submission result- Update
@formspree/react
for the changes introduced to@formspree/core
-
d025831:
@formspree/core
- rename client config
stripePromise
tostripe
since it expects the resolved Stripe client not a promise
@formspree/react
- add a new hook:
useSubmit
which is suitable with code that uses other ways to manage submission state (e.g. with a library like react-hook-form) - update
useForm
to useuseSubmit
under the hood - fix:
FormspreeContext
updates the client whenprops.project
change
- rename client config