react-resizable icon indicating copy to clipboard operation
react-resizable copied to clipboard

Flow type errors: handleSize, minConstraints, maxConstraints

Open ilyabo opened this issue 7 years ago • 8 comments

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • [x] Bug
  • [ ] Feature Request
  • [ ] Question

Problem Report

See reproduction below.

System Info

Node Version: 6.10.2 Browser: n/a OS: OS X

Reproduction

When trying to use in a flow type enabled project I experience these errors:

node_modules/react-resizable/build/ResizableBox.js.flow:55
           v---------
 55:       <Resizable
 56:         handleSize={handleSize}
 57:         width={this.state.width}
...:
 67:         >
             ^ props of React element `Resizable`
 56:         handleSize={handleSize}
                         ^^^^^^^^^^ tuple type. This type is incompatible with
 84:     handleSize: [20, 20],
                     ^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:84

node_modules/react-resizable/build/ResizableBox.js.flow:55
           v---------
 55:       <Resizable
 56:         handleSize={handleSize}
 57:         width={this.state.width}
...:
 67:         >
             ^ props of React element `Resizable`
 63:         minConstraints={minConstraints}
                             ^^^^^^^^^^^^^^ tuple type. This type is incompatible with
 87:     minConstraints: [20, 20],
                         ^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:87

node_modules/react-resizable/build/ResizableBox.js.flow:55
           v---------
 55:       <Resizable
 56:         handleSize={handleSize}
 57:         width={this.state.width}
...:
 67:         >
             ^ props of React element `Resizable`
 64:         maxConstraints={maxConstraints}
                             ^^^^^^^^^^^^^^ tuple type. This type is incompatible with
 88:     maxConstraints: [Infinity, Infinity]
                         ^^^^^^^^^^^^^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:88

ilyabo avatar Jun 02 '17 15:06 ilyabo

Are you on the latest version?

On Jun 2, 2017 10:09 AM, "Ilya Boyandin" [email protected] wrote:

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • [ x] Bug
  • Feature Request
  • Question

Problem Report

Please describe the problem here.

System Info

Node Version: 6.10.2 Browser: n/a OS: OS X Reproduction

When trying to use in a flow type enabled project I experience these errors:

node_modules/react-resizable/build/ResizableBox.js.flow:55 v--------- 55: <Resizable 56: handleSize={handleSize} 57: width={this.state.width} ...: 67: > ^ props of React element Resizable 56: handleSize={handleSize} ^^^^^^^^^^ tuple type. This type is incompatible with 84: handleSize: [20, 20], ^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:84

node_modules/react-resizable/build/ResizableBox.js.flow:55 v--------- 55: <Resizable 56: handleSize={handleSize} 57: width={this.state.width} ...: 67: > ^ props of React element Resizable 63: minConstraints={minConstraints} ^^^^^^^^^^^^^^ tuple type. This type is incompatible with 87: minConstraints: [20, 20], ^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:87

node_modules/react-resizable/build/ResizableBox.js.flow:55 v--------- 55: <Resizable 56: handleSize={handleSize} 57: width={this.state.width} ...: 67: > ^ props of React element Resizable 64: maxConstraints={maxConstraints} ^^^^^^^^^^^^^^ tuple type. This type is incompatible with 88: maxConstraints: [Infinity, Infinity] ^^^^^^^^^^^^^^^^^^^^ array literal. See: node_modules/react-resizable/build/Resizable.js.flow:88

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STRML/react-resizable/issues/67, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFP68Ia5a66Es8dm9Ak_TOQ3UobZ_Nks5sACWZgaJpZM4NuaQC .

STRML avatar Jun 02 '17 17:06 STRML

I have it as a dependency of react-grid-layout:

└─┬ [email protected]
  └── [email protected] 

ilyabo avatar Jun 02 '17 20:06 ilyabo

Same issue here. Would be nice if this could be fixed.

akkie avatar Jul 17 '17 15:07 akkie

I'm not able to reproduce this. Could one of you, who has the error, create a small reproduction repo w/ flowconfig?

STRML avatar Jul 17 '17 17:07 STRML

@STRML Please see: https://github.com/setusoft/react-resizable-flow-issue

akkie avatar Jul 19 '17 06:07 akkie

@STRML Does the created repository help?

akkie avatar Aug 02 '17 11:08 akkie

Can confirm, having the same problem. Have anyone found a way to fix it?

dmoskovtsov avatar Aug 08 '17 04:08 dmoskovtsov

I had this error too and just wanted to mute it.

To mute it, you can adjust your .flowconfig:

[ignore]
.*/node_modules/react-resizable/.*

and then you need a custom libdef with the content:

declare module 'react-resizable' {
    declare module.exports: any;
}

Just a temporary workaround for those affected.

morinted avatar Oct 06 '17 13:10 morinted