Note that leaves must be inline elements #5225
Merged
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.
Description
Adds a note in the walkthrough section of the documentation that leaves must return inline elements.
Issue
This fixes no existing issues.
Context
One of the things I struggled with in my project was figuring out why arrow navigations between nodes were failing. I soon realized it was because my leaves were described as a
div
element, not an inline element. Not only did I have no idea where to find information about leaves, but the section itself doesn't seem to document this behavior. I believe this change can at least help prevent the same mistake and give a little more insight as to how and where to find more information regarding leaves.I also believe updating the Leaves section to include information about this behavior will be great as well. Being new to the repo, I don't understand the logic surrounding leaves enough to contribute to that section.
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)I'm not 100% if leaves must be inline elements. That is what I inferred from its behavior. Please let me know if that is not the case.