Skip to content

feat: deep linking#691

Merged
dannyhw merged 8 commits intonextfrom
feat/deep-linking
Feb 27, 2025
Merged

feat: deep linking#691
dannyhw merged 8 commits intonextfrom
feat/deep-linking

Conversation

@dannyhw
Copy link
Member

@dannyhw dannyhw commented Feb 22, 2025

Issue:

What I did

Adds the ability to link directly to a story without requiring user land code.

This using the react native Linking api directly so assuming your app is configured for deeplinks then you can navigate via deeplinks by passing the STORYBOOK_STORY_ID search param if storybook is being rendered

[scheme]://[url]?STORYBOOK_STORY_ID=[story_id]

This could potentially be used by testing tools like maestro to set the story without interacting with the ui meaning that you can disable the ondevice ui and just navigate purely through linking calls and take screenshots or interact with components.

In the expo go example app for example you can now do this and it will take you to those stories.

npx uri-scheme open "exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-boolean--basic" --ios
or this:
npx uri-scheme open "exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-controlexample--example" --ios

deeplinkstorybook.mp4
storybookdeeplink.mp4

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/expo-example?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@dannyhw dannyhw marked this pull request as ready for review February 23, 2025 10:19
Copy link
Contributor

@fabioatcorreia fabioatcorreia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested and it is working smoothly for me in a React Native CLI Storybook app 💯

@dannyhw
Copy link
Member Author

dannyhw commented Feb 24, 2025

@fabioatcorreia awesome! thanks for testing 🙏

@dannyhw dannyhw merged commit 0423445 into next Feb 27, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants