react-component/cascader

Got typescript error when set strictFunctionTypes.

Closed this issue · 2 comments

The SingleCascaderProps.onChange conflicts with BaseCascaderProps.onChange when i set typescript compilerOptions.strict or compilerOptions.strictFunctionTypes.

// tsconfig.json
// rc-cascader@3.0.0-alpha.6
{
  "compilerOptions": {
    "jsx": "react",
    "target": "ES5",
    "module": "commonjs",
    "lib": ["dom", "es2017", "ES2018", "ES2019", "ES2020"],
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "declaration": true,
    "importHelpers": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "downlevelIteration": true,
    // "strict": true,
    "strictFunctionTypes": true,
    "outDir": "./lib",
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "moduleResolution": "node"
  },
}

image

Having the same issue, MultipleCascaderProps<OptionType> throwing the same error.

I having the same issue,too. I comment the line which include of onChange in interface BaseOptionType.
because MultipleCascaderProps<OptionType> and SingleCascaderProps<OptionType> also defined onChange prop.

Hope the author can revise it in time,thx!