Skip to content
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

TS2559: Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes'. #223

Open
kjsalexander opened this issue Nov 9, 2023 · 2 comments

Comments

@kjsalexander
Copy link

kjsalexander commented Nov 9, 2023

Is this a support request?
No

Describe the bug
The type declaration of withLDProvider throws TS errors about not having anything in common with IntrinsicAttributes. Looking at the source code, it defaults the type to an empty object. If this empty object default is removed, the function runs without any type errors. withLDProvider<T extends JSX.IntrinsicAttributes = {}> should just be withLDProvider<T extends JSX.IntrinsicAttributes>

To reproduce

const Providers = () => {return (<></>)};

export default withLDProvider(launchDarklyConfig)(Providers as React.ComponentType<{}>);
ReactDOM.render(
  <React.StrictMode>
      <Providers>
        <App />
      </Providers>
  </React.StrictMode>,
  document.getElementById("root")
);

Expected behavior
Calling withLDProvider should not throw TS errors, and the app should pass types tests

Logs
error TS2559: Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes'.

SDK version
3.0.9

Language version, developer tools
React 18.2.0
React Dom 18.2.0
Typescript 5.2.2
@types/react 18.2.14
@types/react-dom 18.2.0

OS/platform
macOS Monterey Version 12.6
Also occurs for my team members on various versions of macOS

Additional Context
There was a similar issue opened with version 2.25 of this client when combined with React 18, I'm not sure if that update was missed in version 3 or if this is a different issue. #129

@louis-launchdarkly
Copy link
Contributor

Hello @kjsalexander, thank you for reporting the issue, we will look into this and report back.

Filed internally as 224099.

@MGough
Copy link

MGough commented Oct 18, 2024

@louis-launchdarkly I'm not one to usually bump issues, but this looks like it has been sat here for a year gathering upvotes and it looks like it should be a minor fix. Is there any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants