Documenting the resourceAccessor prop in Storybook#2742
Open
john-osullivan wants to merge 2 commits into
Open
Conversation
|
Ah yes - excellent find thanks John! |
Author
|
Hey @cutterbl , anything else I can do to help get this pushed out to everyone? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
resourceAccessorprop is required if your event objects don't useresourceId, and while it has a docstring in the source code, it's missing from the Storybook docs. This PR sets up the Markdoc and component for it, as well as updating thestoryDefaultprops to show it varying. My chosen text was pulled from the existing docstring in Calendar.js, but links to related props like the docs for the other resource accessors do:https://github.com/jquense/react-big-calendar/blob/7e6ee161b516ed62bbce5ba6923f53eae8323c37/src/Calendar.js#L239-L249
The
resourceIdAccessorandresourceTitleAccessorstill won't allow you to change theeventsand therefore the resource key, so I disabled edits on that param for those stories. However, theresourceAccessorstory will let you inspect & adjust both theeventsandresourcesarrays. Other than that, I followed existing patterns wherever I could.