14: props.title = "";
^ Cannot assign empty string to `props.title` because property `title` is not writable. [cannot-write]
However, flowtype/require-readonly-react-props Eslint rule throws the following (incorrect) error:
Props must be $ReadOnly
For simplification, all of the objects in the union must be readonly even though it's probably not a strict requirement in Flow. This can be improved later when needed.
This change fixes the following (simplified) example from our application:
Flow correctly throws the following error:
However,
flowtype/require-readonly-react-props
Eslint rule throws the following (incorrect) error:For simplification, all of the objects in the union must be readonly even though it's probably not a strict requirement in Flow. This can be improved later when needed.