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

[Documentation]: Update RN documentation around AsyncStorage #7

Closed
jsjoeio opened this issue Nov 21, 2019 · 11 comments
Closed

[Documentation]: Update RN documentation around AsyncStorage #7

jsjoeio opened this issue Nov 21, 2019 · 11 comments
Labels
documentation Improvements or additions to documentation

Comments

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 21, 2019

Is your feature request related to a problem? Please describe.
I'm new user of Storybook. We're using it on a React Native project. I've upgraded to the @next version to remove a warning about AsyncStorage per the recommendation here: https://github.com/storybookjs/storybook/issues/6078#issuecomment-549834805

Now, I see a new warning, which suggests I follow the MIGRATION.md guide, which takes me here: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-native-async-storage

I see the solutions (thank you for those!), but now I'm wondering if I'm choosing the right one.

Use null to disable Async Storage completely.

Also wondering, "What are the benefits of using AsyncStorage within Storybook? It doesn't tell me, and I am struggling to find any documentation around this.

The only relevant info I've found is the PR which adds in the new change:

Describe the solution you'd like
I'd love to see some documentation around why, I as a developer, should use AsyncStorage with React Native Storybook.

Describe alternatives you've considered
I could just leave it as is and not say anything, but I figure I'm not the only one who may stumble into this scenario. And I like what Storybook provides for us, so I'd like to give back.

Are you able to assist bring the feature to reality?
Yes, I'd be happy to update the docs or the MIGRATION.md.

Additional context
Add any other context or screenshots about the feature request here.

@stale
Copy link

stale bot commented Dec 17, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale
Copy link

stale bot commented Jan 16, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Jan 16, 2020
@Gongreg
Copy link
Member

Gongreg commented Jan 16, 2020

Hey @jsjoeio .
Sorry for missing the issue.
The benefit of using Async Storage is that when yuo refresh your app, storybook will open your last visited story.

If you can find a place to put this information somewhere in the documentation, the PR is very welcome :)

@Gongreg Gongreg reopened this Jan 16, 2020
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Jan 16, 2020

Awesome sauce! Thanks for following up on this. I'll find a place an open a PR :)

@shilman shilman transferred this issue from storybookjs/storybook Feb 2, 2020
@Gongreg Gongreg added the documentation Improvements or additions to documentation label Feb 5, 2020
@dannyhw
Copy link
Member

dannyhw commented Feb 12, 2020

@Gongreg after adding asyncStorage I'm not seeing the app return to my last visited story on refresh, is there any other config required for this to work?

@Gongreg
Copy link
Member

Gongreg commented Feb 12, 2020

Hey @dannyhw, how did you enable it? What did you pass to asyncStorage?

@dannyhw
Copy link
Member

dannyhw commented Feb 12, 2020

import {AsyncStorage} from '@react-native-community/async-storage';
const StorybookUIRoot = getStorybookUI({
  asyncStorage: AsyncStorage,
});

However I also tried with require('@react-native-community/async-storage').AsyncStorage

@Gongreg
Copy link
Member

Gongreg commented Feb 12, 2020

Did you fully link it? https://github.com/react-native-community/async-storage There is information about linking it.

@dannyhw
Copy link
Member

dannyhw commented Feb 12, 2020

😅 I just changed import {AsyncStorage} to import AsyncStorage and it started working, now I feel silly haha. I immediately saw this from their example. Thanks for the quick response though!

@Gongreg
Copy link
Member

Gongreg commented Feb 12, 2020

glad that it works :)

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Feb 12, 2020

I did this but forgot to close the issue:

Closing via storybookjs/storybook#9494

@jsjoeio jsjoeio closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants