pub struct NoCascadingSetStateRule { /* private fields */ }Expand description
Flags useEffect callbacks that call too many setState functions.
Multiple set* calls inside a single useEffect often cause cascading
re-renders. This rule counts calls to functions matching set[A-Z]*
within each useEffect callback body and flags when the count reaches
max_count (default 3).
Implementations§
Source§impl NoCascadingSetStateRule
impl NoCascadingSetStateRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Rule for NoCascadingSetStateRule
impl Rule for NoCascadingSetStateRule
Auto Trait Implementations§
impl Freeze for NoCascadingSetStateRule
impl RefUnwindSafe for NoCascadingSetStateRule
impl Send for NoCascadingSetStateRule
impl Sync for NoCascadingSetStateRule
impl Unpin for NoCascadingSetStateRule
impl UnsafeUnpin for NoCascadingSetStateRule
impl UnwindSafe for NoCascadingSetStateRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more