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

[brightness] rename method to prevent violating Rules of Hooks #19701

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

Simek
Copy link
Collaborator

@Simek Simek commented Oct 26, 2022

Why

Fixes ENG-1738

How

Deprecate useSystemBrightnessAsync and add it as renamed restoreSystemBrightnessAsync method to avoid violating Rules of Hooks.

Test Plan

The changes have been tested by running docs website and NCL app locally in emulator.

Preview

Screenshot 2022-10-26 at 13 31 54

Checklist

@linear
Copy link

linear bot commented Oct 26, 2022

ENG-1738 [brightness] Rename `useSystemBrightnessAsync`

Current name (starting with use) causes ESLint and API Auto-Gen to interpreter this method as hook, which it isn't. It also violates the rules of hooks:

New name proposal:

  • resetToSystemBrightnessAsync
  • restoreSystemBrightnessAsync

@Simek Simek changed the title [brightness] rename method to prevent violating of Rules of Hooks [brightness] rename method to prevent violating Rules of Hooks Oct 26, 2022
@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 26, 2022
Copy link
Member

@amandeepmittal amandeepmittal left a comment

Choose a reason for hiding this comment

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

Thanks for these changes! 🚀

Copy link
Member

@tsapeta tsapeta left a comment

Choose a reason for hiding this comment

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

You'll probably need to rebase it and fix the changelog entry. If you want this patch to be published for SDK 47, you would need to revert native changes and rename the function only on the JS side 😉

@Simek Simek force-pushed the simek/eng-1738-brightness-rename branch from a2512ce to 204db58 Compare November 2, 2022 08:30
@Simek Simek merged commit 9100359 into main Nov 2, 2022
@Simek Simek deleted the simek/eng-1738-brightness-rename branch November 2, 2022 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants