Тип пропуска Eslint отключен, когда я использую оператор распространения на компоненте - PullRequest
0 голосов
/ 05 декабря 2018

когда я использую оператор распространения внутри компонента, проп-типы eslint не дают мне никакой ошибки;

пример:

  • это не дает мне ошибку:

`

const { status } = props //status not have an error
let customProps = null;
if (status === 1) customProps = { style: { flex: 0.2 } };
else if (status === 2) customProps = { style: { flex: 0.4 } };

if (!customProps) return null;

return (
  <View {...customProps}>
  </View>
);

`

  • это дает мне ошибку:

`

const { status } = props //status have an error
let customProps = null;
if (status === 1) customProps = { style: { flex: 0.2 } };
else if (status === 2) customProps = { style: { flex: 0.4 } };

if (!customProps) return null;

return (
  <View>
  </View>
);

`

...