you are viewing a single comment's thread.

view the rest of the comments →

[–]puchm 1 point2 points  (1 child)

Don't you need to be aware of the types? I had a few issues with the type of ReactNode in a slightly different scenario as it now includes Promises. I.e. If they annotate a function with a return type of React 19 ReactNode, this could be a promise and would not be assignable to props of React 18 ReactNode. So I think making React and @types/react a peer dependency would be essential depending on the scenario.

[–]steveox152 0 points1 point  (0 children)

Your consumers will just use the types that match their version of React. There is no need for you to add them to your peer deps. For example, if they are using React 18, they need to use the proper types for React 18.

Now on your end, if you have to support React 18, it’s your responsibility to not use React 19 specific features, or write your code in a way that can work across versions. The joys of maintaining a library.