Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 566 Bytes

no-state-destructuring.md

File metadata and controls

31 lines (22 loc) · 566 Bytes

no-state-destructuring (no-state-destructuring)

This rule warns about a Mitosis limitation.

Rule Details

This rule aims to warn you if you try to use destructuring with state.

Examples of incorrect code for this rule:

export default function MyComponent() {
  const state = useStore({ foo: '1' });

  onMount(() => {
    const { foo } = state;
  });
}

Examples of correct code for this rule:

export default function MyComponent() {
  const state = useStore({ foo: '1' });

  onMount(() => {
    const foo = state.foo;
  });
}