-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Enable eslint-plugin-react-hooks for react-next #14478
Conversation
* The left position of the beak | ||
*/ | ||
const [beakLeft, setBeakLeft] = React.useState<string>(); | ||
return React.useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parts of the beak position will never change independently, so this is a much more efficient way to calculate and update them.
}); | ||
timeoutIds.splice(0, timeoutIds.length); // clear array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, the array of timeouts keeps unnecessarily growing (and each one is unnecessarily cleared again) with every resize event
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 98de017:
|
packages/react-next/src/components/Coachmark/Coachmark.base.tsx
Outdated
Show resolved
Hide resolved
0b9279a
to
d16d6ba
Compare
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
Asset size changes
Over Tolerance (1024 B) Over Baseline Below Baseline New Removed 1 kB = 1000 B Baseline commit: e34570d86cd27872c5b76c06022757afbaf22707 (build) |
🎉 Handy links: |
Pull request checklist
$ yarn change
Description of changes
Enable
eslint-plugin-react-hooks
for react-next to help catch hook-related mistakes, and fix existing issues. Also add a rule to our eslint config to help catch accidental usage of DOM globals (such asfocus()
which was accidentally used in SearchBox).In the interest of getting this merged more quickly, I temporarily disabled the rule in a bunch of places for CalloutContent and SpinButton and will make follow-up issues to fix this.
Also started making some updates to the release notes breaking changes to alphabetize components and add a couple missing things (or notes about components to look over later).