-
Notifications
You must be signed in to change notification settings - Fork 20
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
Chore : Clean hook usage in UseLunatic #388
base: v3-master
Are you sure you want to change the base?
Conversation
02b6f64
to
e47083a
Compare
e47083a
to
ab18589
Compare
@@ -1,4 +1,4 @@ | |||
import { useEffect, useState, PropsWithChildren, useCallback } from 'react'; |
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.
{ type PropsWithChildren, ...}`
return personalization.reduce((acc, { name, value }) => { | ||
return { ...acc, [name]: value }; | ||
}, {}); | ||
): Record<string, string | number | boolean> { |
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.
Why return type is not infered ?
return { ...acc, [name]: value }; | ||
}, {}); | ||
): Record<string, string | number | boolean> { | ||
return Object.fromEntries(personalization.map((p) => [p.name, p.value])); | ||
} | ||
|
||
export function UseLunatic(props: PropsWithChildren<OrchestratorProps>) { |
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.
Hooks must be uncapitalized in React ?
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Some hooks had bad pratices (setter in useEffect) that triggers unecessary renders.