React: Don't show decorators in JSX snippets#21907
Merged
Merged
Conversation
This is a bit of a hacky way to acheive `excludeDecorators` without actually excluding them.
Contributor
|
I think this is an interesting solution.
|
shilman
reviewed
Apr 4, 2023
Member
Author
|
@JReinhold as far as we currently understand it, the issue is only a problem for react (well maybe there's an issue in that you see all the decorators in other frameworks but at least you see the story inside them). So we think as a patch release a localised fix like this is a good idea. Probably a better solution would be some 1st class way to declare a decorator as an "story inspector" or something so it gets wrapped inside the other decorators. Unless we can find a better solution I'd propose that as a 7.1 PR |
Base automatically changed from
shilman/21900-revert-source-exclude-decorators
to
next
April 5, 2023 12:53
shilman
approved these changes
Apr 5, 2023
4 tasks
shilman
added a commit
that referenced
this pull request
Apr 6, 2023
…orator-order React: Don't show decorators in JSX snippets
4 tasks
8 tasks
8 tasks
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.
Telescoping on #21902
An alternate solution for #21649
What I did
Always move the JSX decorator to the end of the list, so it avoids all other decorators, as we can't see "inside" decorators in React. However we still need to actually render all the decorators as the story may depend on them.
TODO:
How to test
See stories in this PR:
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:mergedorci:dailyGH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]