Imcompatible with Flow 0.99.0 and newer
See original GitHub issueHello! Sorry for removing the issue template.
I upgraded my project to Flow 0.99.0 from 0.98.1, and discovered that it throws new errors for this library.
Would you accept a PR fixing them?
It seems we hit this new feature from 0.99.0
Fix an issue where Flow would not catch certain errors involving React function components with unannotated props.
Errors:
Error βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ node_modules/react-select/src/Select.js:442:23
Cannot assign defaultComponents(...) to this.components because:
β’ property children is missing in props [1] but exists in object type [2] in property Menu.
β’ property innerRef is missing in props [1] but exists in object type [2] in property Menu.
node_modules/react-select/src/Select.js
439β document.removeEventListener('scroll', this.onScroll, true);
440β }
441β cacheComponents = (components: SelectComponents) => {
442β this.components = defaultComponents({ components });
443β };
444β // ==============================
445β // Consumer Handlers
node_modules/react-select/src/components/Menu.js
[2] 225β export type MenuProps = MenuAndPlacerCommon & {
226β /** Reference to the internal element, consumed by the MenuPlacer component */
227β innerRef: ElementRef<*>,
228β /** The children to be rendered. */
229β children: ReactElement<*>,
230β };
node_modules/react-select/src/components/index.js
[1] 64β Menu: ComponentType<MenuProps>,
Error βββββββββββββββββββββββββββββββββββββββββββββββββββββββ node_modules/react-select/src/animated/MultiValue.js:12:10
Cannot return function because:
β’ property in is missing in props [1].
β’ property onExited is missing in props [1].
9β const AnimatedMultiValue = (
10β WrappedComponent: AbstractComponent<MultiValueProps>
[1] 11β ): AbstractComponent<MultiValueProps> => {
12β return ({ in: inProp, onExited, ...props }) => (
13β <Collapse in={inProp} onExited={onExited}>
14β <WrappedComponent cropWithEllipsis={inProp} {...props} />
15β </Collapse>
16β );
17β };
18β
19β export default AnimatedMultiValue;
Error βββββββββββββββββββββββββββββββββββββββββββββββββββββββ node_modules/react-select/src/animated/Placeholder.js:11:4
Cannot create Fade element because:
β’ property in is missing in props [1] but exists in BaseTransition [2].
β’ property onExited is missing in props [1] but exists in BaseTransition [2].
node_modules/react-select/src/animated/Placeholder.js
8β const AnimatedPlaceholder = (
9β WrappedComponent: AbstractComponent<PlaceholderProps>
10β ): AbstractComponent<PlaceholderProps> => (props) => (
[1] 11β <Fade
12β component={WrappedComponent}
13β duration={props.isMulti ? collapseDuration : 1}
14β {...props}
15β />
16β );
17β
18β export default AnimatedPlaceholder;
node_modules/react-select/src/animated/transitions.js
[2] 18β type FadeProps = BaseTransition & {
Error βββββββββββββββββββββββββββββββββββββββββββββββββββββββ node_modules/react-select/src/animated/SingleValue.js:12:4
Cannot create Fade element because:
β’ property duration is missing in props [1] but exists in object type [2].
β’ property in is missing in props [1] but exists in BaseTransition [3].
β’ property onExited is missing in props [1] but exists in BaseTransition [3].
node_modules/react-select/src/animated/SingleValue.js
9β const AnimatedSingleValue = (
10β WrappedComponent: AbstractComponent<SingleValueProps>
11β ): AbstractComponent<SingleValueProps> => (props) => (
[1] 12β <Fade component={WrappedComponent} {...props} />
13β );
14β
15β export default AnimatedSingleValue;
node_modules/react-select/src/animated/transitions.js
[3][2] 18β type FadeProps = BaseTransition & {
19β component: ComponentType<any>,
20β duration: number,
21β };
Error ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ node_modules/react-select/src/animated/index.js:14:10
Cannot return object literal because:
β’ property children is missing in props [1] but exists in object type [2] in property Menu.
β’ property innerRef is missing in props [1] but exists in object type [2] in property Menu.
node_modules/react-select/src/animated/index.js
11β const makeAnimated = (externalComponents?: SelectComponents= {}): SelectComponents => {
12β const components = defaultComponents({ components: externalComponents });
13β const { Input, MultiValue, Placeholder, SingleValue, ValueContainer, ...rest } = components;
14β return {
15β Input: AnimatedInput(Input),
16β MultiValue: AnimatedMultiValue(MultiValue),
17β Placeholder: AnimatedPlaceholder(Placeholder),
18β SingleValue: AnimatedSingleValue(SingleValue),
19β ValueContainer: AnimatedValueContainer(ValueContainer),
20β ...rest,
21β };
22β };
23β
24β const AnimatedComponents = makeAnimated();
node_modules/react-select/src/components/Menu.js
[2] 225β export type MenuProps = MenuAndPlacerCommon & {
226β /** Reference to the internal element, consumed by the MenuPlacer component */
227β innerRef: ElementRef<*>,
228β /** The children to be rendered. */
229β children: ReactElement<*>,
230β };
node_modules/react-select/src/components/index.js
[1] 64β Menu: ComponentType<MenuProps>,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Flow-type throws error with Selectprops Β· Issue #3804 - GitHub
All branches are incompatible: β’ Either property selectProps is missing in PropsWithStyles [1]. β’ Or property selectProps is missing in objectΒ ...
Read more >Flow type error: "number [1] is incompatible with `Number` [2 ...
You need to change index: Number,. to be index: number,. A Number is an object, number is a primitive type.
Read more >Read more - GitHub
0.101.0 Likely to cause new Flow errors: * `$Keys` now produces a more precise type, which may find errors where incompatible strings were...
Read more >Coronary Flow Velocity and Disturbed Flow Predict Adverse ...
We hypothesized that disturbed blood flow after coronary angioplasty is associated with adverse long-term clinical outcome. Methods and Resultsβ TheΒ ...
Read more >Quantitative Evaluation of Post-stenotic Blood Flow ... - NCBI
V Flow was used to measure femoral artery flow turbulence index (Tur) ... Zhu L. High frame rate vector flow imaging: Development as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case it helps anyone - weβve recently ran into this on a project were integrating the react-select library, and as a temporary fix added the following to the
.flowconfig
:However this results in another error where importing the library:
So in addition to the above, mark the import line with
$FlowFixMe
(all this until #3626 is resolved).It appears this will be resolved when PR #3626 is merged.