Skip to content

Commit

Permalink
Use React.createElement instead of JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
vjee committed Feb 11, 2024
1 parent 5f5fc2e commit c506195
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-goats-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@formulier/react": patch
---

Use React.createElement instead of JSX
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/react/src/form.tsx → packages/react/src/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {FormContext, FormProviderProps, Selector} from './types.js'
const formContext = React.createContext<FormContext<Values, Primitives> | undefined>(undefined)

function FormProvider<V extends Values, P extends Primitives = Primitives>({form, children}: FormProviderProps<V, P>) {
return <formContext.Provider value={{form: form as Formulier<Values>}}>{children}</formContext.Provider>
return React.createElement(formContext.Provider, {value: {form: form as Formulier<Values>}}, children)
}

function useFormInstance<V extends Values, P extends Primitives = Primitives>() {
Expand Down

0 comments on commit c506195

Please sign in to comment.