Skip to content

Disabled: Add documentation for 'Disabled.Context' - #39627

Merged
Mamaduka merged 5 commits into
trunkfrom
docs/disabled-context
Mar 23, 2022
Merged

Mamaduka merged 5 commits into
trunkfrom
docs/disabled-context

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

What?

PR adds documentation for Disabled.Context, introduced in #31134.

Why?

Reading context with useContext should be preferred when possible.

How?

PR updates documentation and adds notes about the preferred method.

@Mamaduka
Mamaduka requested a review from ajitbohra as a code owner March 22, 2022 07:31
@Mamaduka Mamaduka self-assigned this Mar 22, 2022
@Mamaduka Mamaduka added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Mar 22, 2022
@Mamaduka
Mamaduka requested review from ciampo and gziolo March 22, 2022 07:32
@ciampo
ciampo requested a review from mirka March 22, 2022 09:32

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since context is a standard React API (and there's even a link to the docs), I wonder if we should just keep the hook version of the example and remove the "legacy" version.

@Mamaduka

Copy link
Copy Markdown
Member Author

@ciampo I was thinking the same. The new React docs also recommend using the useContext hook over Context.Consumer.

Happy to update the readme if you're okay with that.

@ciampo

ciampo commented Mar 22, 2022

Copy link
Copy Markdown
Contributor

Happy to update the readme if you're okay with that.

Let's do that, thank you!

@Mamaduka

Copy link
Copy Markdown
Member Author

Updated.

Mamaduka and others added 2 commits March 22, 2022 19:23
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

Thank you for the patience in addressing the feedback! I really appreciate your help in contributing to the components package

@Mamaduka

Copy link
Copy Markdown
Member Author

Thanks for the reviews, @ciampo.

@Mamaduka
Mamaduka merged commit 1440426 into trunk Mar 23, 2022
@Mamaduka
Mamaduka deleted the docs/disabled-context branch March 23, 2022 13:53
@github-actions github-actions Bot added this to the Gutenberg 13.0 milestone Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants