Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add section about slotOptions in README #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Sep 12, 2024

In the README, documents the slotOptions.mergeProps option to change the behavior of PluginSlot components to merge custom attributes with existing props on widgets.

Preview

image

Also updates existing code blocks to use javascript syntax highlighting.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.80%. Comparing base (f34f4df) to head (1ccfd07).

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.
📢 Have feedback on the report? Share it here.

Documents the `slotOptions.mergeProps` option to change the behavior of `PluginSlot` components to merge custom attributes with existing props on widgets.
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👀

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