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

feat: add useControlledState hook #1276

Merged
merged 3 commits into from
Jan 26, 2024
Merged

feat: add useControlledState hook #1276

merged 3 commits into from
Jan 26, 2024

Conversation

ValeraS
Copy link
Contributor

@ValeraS ValeraS commented Jan 26, 2024

No description provided.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.


import {useControlledState} from './useControlledState';

describe('useControlledState tests', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

"tests" word is redundant I guess

const wasControlled = isControlledRef.current;
if (wasControlled !== isControlled) {
console.warn(
`WARN: A component changed from ${
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use console.error for better visibility. Also let's use the following format: [useControlledState] <message>

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@ValeraS ValeraS merged commit 5add67d into next Jan 26, 2024
4 checks passed
@ValeraS ValeraS deleted the feat/useControlledState branch January 26, 2024 20:34
amje pushed a commit that referenced this pull request Feb 1, 2024
amje pushed a commit that referenced this pull request Feb 6, 2024
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.

4 participants