docs: add section about slotOptions in README#88
Open
adamstankiewicz wants to merge 1 commit intoopenedx:masterfrom
Open
docs: add section about slotOptions in README#88adamstankiewicz wants to merge 1 commit intoopenedx:masterfrom
slotOptions in README#88adamstankiewicz wants to merge 1 commit intoopenedx:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #88 +/- ##
=======================================
Coverage 97.80% 97.80%
=======================================
Files 10 10
Lines 228 228
Branches 58 58
=======================================
Hits 223 223
Misses 4 4
Partials 1 1 ☔ View full report in Codecov by Sentry. |
085a03d to
a477a7d
Compare
Documents the `slotOptions.mergeProps` option to change the behavior of `PluginSlot` components to merge custom attributes with existing props on widgets.
a477a7d to
1ccfd07
Compare
Contributor
brian-smith-tcril
left a comment
There was a problem hiding this comment.
It's awesome to see more documentation like this! One little comment.
Comment on lines
+300
to
+303
| ``mergeProps`` | ||
| '''''''''''''' | ||
|
|
||
| When enabled, this option will merge custom/overridden attributes with existing props passed to the widget, as opposed to passing these attributes to the widget via a ``content`` prop. This is especially useful when using a ``PluginSlot`` to support any custom attributes as well as handle special cases such as merging of custom class names with existing class names. |
Contributor
There was a problem hiding this comment.
It might be nice to have a short description of the default (mergeProps: false) behavior here. I could see someone reading this and thinking, "as opposed to what?"
Member
Author
There was a problem hiding this comment.
This is alluded to in the above "..., as opposed to passing these attributes to the widget via a content prop.". I suppose this could be more clearly communicated, though 👀
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.
In the README, documents the
slotOptions.mergePropsoption to change the behavior ofPluginSlotcomponents to merge custom attributes with existing props on widgets.Preview
Also updates existing code blocks to use
javascriptsyntax highlighting.