niuware/mui-rte

TypeScript error after dependency upgrade

drxcheng opened this issue · 3 comments

Checklist

Description

After I upgrade dependencies in my project, I get this error

.../node_modules/mui-rte/src/MUIRichTextEditor.tsx
TypeScript error in .../node_modules/mui-rte/src/MUIRichTextEditor.tsx(1017,32):
Argument of type 'KeyboardEvent<{}>' is not assignable to parameter of type 'SyntheticKeyboardEvent'.
  Property 'code' is missing in type 'React.KeyboardEvent<{}>' but required in type 'import(".../node_modules/@types/react-redux/node_modules/@types/react/index").KeyboardEvent<{}>'.  TS2345

    1015 | 
    1016 |     const keyBindingFn = (e: React.KeyboardEvent<{}>): string | null => {
  > 1017 |         if (hasCommandModifier(e) && props.keyCommands) {
         |                                ^
    1018 |             const comm = props.keyCommands.find(comm => comm.key === e.keyCode)
    1019 |             if (comm) {
    1020 |                 return comm.name

mui-rte version: 1.26.2
draft-js version: 0.11.7
@types/draft-js version: 0.10.44
@types/react version: 17.0.0 & 16.14.2
@types/react-redux version: 7.1.11

Duplicated: #214

Hopefully will remove typescript files from the release code in the near future.

is there any workaround for now?

unifying one react type version fixes it