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

Fix the d.ts file of addon-links, mark LinkTo in index as deprecated #20671

Merged
merged 3 commits into from
Jan 20, 2023

Conversation

ndelangen
Copy link
Member

Issue: #20580

What I did

  • Add react entrypoint to types exports map
  • fix the .d.ts file which seems to suffer from a bug in tsup
    Can likely be removed at 8.0 when preview-api is simplified
  • mark LinkTo as deprecated in the index entrypoint

@ndelangen
Copy link
Member Author

I found of there was confusion about the LinkTo component, which should come from the react entrypoint, but everything else should come from the index entrypoint:
https://github.com/DannyJoris/storybook-nextjs-linkto/pull/1/files#diff-8f0abfa5fd53937fe7e24ab4c3987d3b9e6558e770409898a13b2800934aab02R1-R2

@ndelangen ndelangen merged commit 3f1ece9 into next Jan 20, 2023
@ndelangen ndelangen deleted the norbert/fix-20580 branch January 20, 2023 13:17
@DannyJoris
Copy link

@ndelangen Thanks for that!

The TypeScript issue for LinkTo still remains it looks like. This is using 7.0.0-beta.31:

Screenshot 2023-01-23 at 10 49 36 AM

@ndelangen
Copy link
Member Author

ndelangen commented Jan 24, 2023

@DannyJoris do you have any custom type definitions setup for @storybook/addon-links?

try adding this to the top of your file:

import React from 'react'

I was able to make it work in a sandbox:
Screenshot 2023-01-24 at 11 08 18

@DannyJoris
Copy link

DannyJoris commented Jan 24, 2023

@ndelangen No other types defined, and importing React didn't work either.

What did work is upgrading: something in beta32 or 33 fixed it: #20580 (comment)

Thanks again for all your help! I appreciate it.

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

Successfully merging this pull request may close these issues.

2 participants