react-client-sdk icon indicating copy to clipboard operation
react-client-sdk copied to clipboard

Version 3.0.7 introduces incompatibility with @types/react 17.0.43

Open kbaum opened this issue 2 years ago • 3 comments
trafficstars

Is this a support request? This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going here or by emailing [email protected].

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

Describe the bug We use version 17.0.43 of @types/react. When upgrading from 3.0.6 to 3.0.7 of this library, we get the following typescript errors:

node_modules/launchdarkly-react-client-sdk/lib/index.d.ts:195:30 - error TS2694: Namespace 'React' has no exported member 'JSX'.

195     render(): React__default.JSX.Element;
                                 ~~~

node_modules/launchdarkly-react-client-sdk/lib/index.d.ts:246:22 - error TS2694: Namespace 'React' has no exported member 'JSX'.

246 }) => React__default.JSX.Element>;
                         ~~~

node_modules/launchdarkly-react-client-sdk/lib/index.d.ts:283:140 - error TS2694: Namespace 'React' has no exported member 'JSX'.

283 declare function withLDConsumer(options?: ConsumerOptions): <P>(WrappedComponent: React.ComponentType<P & LDProps>) => (props: P) => React.JSX.Element;
                                                                                                                                               ~~~


Found 3 errors in the same file, starting at: node_modules/launchdarkly-react-client-sdk/lib/index.d.ts:195

To reproduce Steps to reproduce the behavior.

Expected behavior No typescript errors.

Logs If applicable, add any log output related to your problem.

SDK version 3.0.7

Language version, developer tools react 17.0.2 @types/react 17.0.43 typescript 4.7.4

OS/platform macOS Ventura 13.5.2

Additional context Version 3.0.6 does not have this issue.

kbaum avatar Nov 13 '23 19:11 kbaum

Hello @kbaum, thank you for raising the question. I have filed 224215 internally to track this.

By the way, is this still happening if you try to use 3.0.8 or 3.0.9? We have added some type-export changes and I wonder would those changes help in this case.

louis-launchdarkly avatar Nov 14 '23 23:11 louis-launchdarkly

This is still happening in version 3.0.10. We are also using react 17.0.2, @types/react 17.0.45 and typescript 4.9.4.

jarivalentine avatar Mar 15 '24 11:03 jarivalentine

Sorry. I am on a different project now and do not have access to the original project I posted this about.

kbaum avatar Apr 22 '24 10:04 kbaum