Skip to content

Documenting the resourceAccessor prop in Storybook#2742

Open
john-osullivan wants to merge 2 commits into
bigcalendar:masterfrom
john-osullivan:resource-accessor-docs
Open

Documenting the resourceAccessor prop in Storybook#2742
john-osullivan wants to merge 2 commits into
bigcalendar:masterfrom
john-osullivan:resource-accessor-docs

Conversation

@john-osullivan
Copy link
Copy Markdown

@john-osullivan john-osullivan commented Apr 11, 2025

The resourceAccessor prop is required if your event objects don't use resourceId, 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 the storyDefault props 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 resourceIdAccessor and resourceTitleAccessor still won't allow you to change the events and therefore the resource key, so I disabled edits on that param for those stories. However, the resourceAccessor story will let you inspect & adjust both the events and resources arrays. Other than that, I followed existing patterns wherever I could.

@michaelruhl
Copy link
Copy Markdown

Ah yes - excellent find thanks John!

@john-osullivan
Copy link
Copy Markdown
Author

Hey @cutterbl , anything else I can do to help get this pushed out to everyone?

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