-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chore] Bump to React 19 #307
Conversation
i haven't used react 19 alot yet but they say it's stable so why not! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :)
I had a couple of type errors when building because diff --git a/packages/web/src/components/ui/button.tsx b/packages/web/src/components/ui/button.tsx
index 67c464a..bb72199 100644
--- a/packages/web/src/components/ui/button.tsx
+++ b/packages/web/src/components/ui/button.tsx
@@ -35,7 +35,7 @@ const buttonVariants = cva(
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
- ref: React.Ref<HTMLButtonElement>;
+ ref?: React.Ref<HTMLButtonElement>;
}
const Button = ({ className, variant, size, ref, ...props }: ButtonProps) => {
diff --git a/packages/web/src/components/ui/input.tsx b/packages/web/src/components/ui/input.tsx
index 8e0da2d..cd4bbf8 100644
--- a/packages/web/src/components/ui/input.tsx
+++ b/packages/web/src/components/ui/input.tsx
@@ -4,7 +4,7 @@ import { cn } from "@/lib/utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {
- ref: React.Ref<HTMLInputElement>;
+ ref?: React.Ref<HTMLInputElement>;
}
const Input = ({ className, ref, ...props }: InputProps) => { @TodePond do you think this will be fine? |
Just went ahead and merge it. Thanks again! |
amazing! and im not sure, i can take a look after christmas if no one else beats me to it :) seems to work(!?) |
Closes #306
Normally I wouldn't bother updating but React 19 removes the need for
forwardRef
which flok uses a lot because of juggling different UIs and editors. So it might make it easier to do more fixes, improvements, etc.https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop
I came across this while working on #305
This PR
forwardRef
s to usingref
as a propNo worries if this isn't wanted! But I hope you see the appeal and I think it could help future work :) Lemme know!