Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix read-only React props error position (#478)
Example from our repo before this change: ``` error: Props must be $ReadOnly (flowtype/require-readonly-react-props) at src/kochka.com.mx/src/Layout.js:39:7: 37 | return ( 38 | <> > 39 | <Head> | ^ 40 | <title>KOCHKA café · {props.title}</title> 41 | </Head> 42 | ``` As you can see the error seems to be wrongly positioned. This is even more awkward when you want to suppress this error (and you have to do it on some unrelated line). After this fix: ``` error: Props must be $ReadOnly (flowtype/require-readonly-react-props) at src/kochka.com.mx/src/Layout.js:28:39: 26 | }; 27 | > 28 | export default function Layout(props: Props): React.Node { | ^ 29 | if (props.withHiddenTitle === true) { 30 | invariant(props.title == null, 'Cannot use `title` together with `withHiddenTitle` property.'); 31 | invariant( ```
- Loading branch information