Skip to content

Commit

Permalink
upgrade to react 19
Browse files Browse the repository at this point in the history
  • Loading branch information
berekuk committed Nov 30, 2024
1 parent 15d4c11 commit bf6ceac
Show file tree
Hide file tree
Showing 5 changed files with 789 additions and 221 deletions.
6 changes: 3 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"lodash": "^4.17.21",
"prettier": "^3.3.3",
"react-draggable": "^4.4.6",
"react-hook-form": "^7.50.0",
"react-hook-form": "^7.53.2",
"react-markdown": "^9.0.1",
"reactflow": "^11.11.4",
"remark-gfm": "^4.0.0",
Expand Down Expand Up @@ -82,8 +82,8 @@
"jsdom": "^25.0.1",
"postcss": "^8.4.38",
"postcss-cli": "^11.0.0",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"rollup-plugin-node-builtins": "^2.1.2",
"storybook": "^8.1.6",
"tailwindcss": "^3.4.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"next-auth": "5.0.0-beta.25",
"nodemailer": "^6.9.13",
"pako": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react-hook-form": "^7.50.0",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-hook-form": "^7.53.2",
"react-icons": "^5.2.1",
"react-loading-skeleton": "^3.4.0",
"react-markdown": "^9.0.1",
Expand Down
11 changes: 6 additions & 5 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"types": "./dist/index.d.ts",
"source": "./src/index.ts",
"peerDependencies": {
"react": "^18",
"react-dom": "^18"
"react": "^18 | ^19",
"react-dom": "^18 | ^19",
"react-hook-form": "^7.53.2"
},
"dependencies": {
"@floating-ui/react": "^0.26.16",
"@headlessui/react": "^2.2.0",
"clsx": "^2.1.1",
"framer-motion": "^11.0.3",
"react-colorful": "^5.6.1",
"react-hook-form": "^7.50.0",
"react-select": "^5.8.0",
"react-textarea-autosize": "8.5.4",
"react-use": "^17.5.0"
Expand All @@ -77,8 +77,9 @@
"postcss-cli": "^11.0.0",
"prettier": "^3.3.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-hook-form": "^7.53.2",
"rollup-plugin-node-builtins": "^2.1.2",
"storybook": "^8.1.5",
"tailwindcss": "^3.4.14",
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/forms/common/FormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export function FormInput<
TValues extends FieldValues,
TFieldName extends FieldPath<TValues> = FieldPath<TValues>,
>({ name, rules, children }: Props<TValues, TFieldName>) {
const { register } = useFormContext<TValues>();
const formContext = useFormContext<TValues>();
if (!formContext) {
throw new Error("FormInput must be used within a FormProvider");
}

const { register } = formContext;

return (
<WithRHFError<TValues, TFieldName> name={name}>
Expand Down
Loading

0 comments on commit bf6ceac

Please sign in to comment.