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

Allow access to the "LDProps" Typescript interface used by the withLDConsumer HoC #322

Open
kallevmercury opened this issue Oct 24, 2024 · 0 comments

Comments

@kallevmercury
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It's currently not possible to access the LDProps Typescript interface directly since the library does not export it.

Describe the solution you'd like
I would like to be able to import the LDProps type like this in React code:

import type {LDProps} from 'launchdarkly-react-client-sdk'

interface MyProps extends LDProps, SomeCommonProps { }

Describe alternatives you've considered
The current workarounds have involved duplicating the TS interface into the codebase or attempting to infer it from the withLDConsumer parameter types. The latter option does not work well with IDEs and IntelliSense.

Additional context
N/A

kinyoklion added a commit that referenced this issue Nov 1, 2024
…ion code (#321)

**Requirements**

- [ ] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform
versions

**Related issues**

#322

**Describe the solution you've provided**

With this change, it is possible to import the LDProps type from the
library like this:
```ts
import type {LDProps} from 'launchdarkly-react-client-sdk'
```

**Describe alternatives you've considered**

The current workarounds have involved duplicating the TS interface into
the codebase or attempting to infer it from the `withLDConsumer`
parameter types. The latter option does not work well with IDEs and
IntelliSense.

**Additional context**

N/A

---------

Co-authored-by: Ryan Lamb <[email protected]>
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

1 participant