You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node_modules/@blueprintjs/select/src/common/itemRenderer.ts:72:80 - error TS2694: Namespace 'React' has no exported member 'JSX'.
72 export type ItemRenderer<T> = (item: T, itemProps: ItemRendererProps) => React.JSX.Element | null;
~~~
Found 1 error in node_modules/@blueprintjs/select/src/common/itemRenderer.ts:72
Expected behavior
There are no type errors
Possible solution
React.JSX.Element was introduced in@types/react@18.2.6. This makes its use incompatible with the @blueprintjs/select@5.1.5 package's peerDependencies which specifies:
Older versions of React could be supported by changing from React.JSX.Element -> JSX.Element, though I have only tested with @types/react@17.0.53. I have not tested with @types/react@16.14.41.
The text was updated successfully, but these errors were encountered:
React.JSX.Element was introduced in@types/react@18.2.6.
It looks like that change also edited @types/react versions v15, v16, and v17. 🤔
Adi updated the minimum Blueprint supported version to v16.14.41 here: #6634
@types/react is now on the latest v16 typings. There was a change to deprecate the global JSX namespace in favor of the React.JSX namespace in May 2023 via DefinitelyTyped/DefinitelyTyped@f1b2559, which was released in v16.14.41, so that is now the new minimum supported version of React types.
I think the right fix here is to be more specific Blueprint's @types/react peer dependencies and include minimum versions for 17.x and 18.x as well. Example:
Thanks for the response, @types/react@17.0.59 works!
My main reasoning for suggesting returning to JSX.Element was to avoid any potential semver major version change issue (not sure if that's required for the peer dep change being asked for, but I think technically it is?). Will let y'all decide on that though, a patch version with clear docs about why folks might be getting new peer dep warnings is probably fine since they don't need to make a major version change to @types/react. Thanks!
Environment
react
version: 17.0.2@types/react
version: 17.0.53Code Sandbox
Link to a minimal repro (fork this code sandbox):
Steps to reproduce
Actual behavior
Trying to build types failed:
Expected behavior
There are no type errors
Possible solution
React.JSX.Element
was introduced in@types/react@18.2.6
. This makes its use incompatible with the@blueprintjs/select@5.1.5
package'speerDependencies
which specifies:Older versions of React could be supported by changing from
React.JSX.Element
->JSX.Element
, though I have only tested with@types/react@17.0.53
. I have not tested with@types/react@16.14.41
.The text was updated successfully, but these errors were encountered: