Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 类型';供应商<;任何行动>';不见了_Reactjs_Typescript_Redux - Fatal编程技术网

Reactjs 类型';供应商<;任何行动>';不见了

Reactjs 类型';供应商<;任何行动>';不见了,reactjs,typescript,redux,Reactjs,Typescript,Redux,我正在用typescript做react项目 这是我在index.ts中的代码 const store = configureStore(initialStateFromDB); ReactDOM.render( <Provider store={store}> <App></App> </Provider>, document.getElementById('app') ); const store=configureSto

我正在用typescript做react项目

这是我在index.ts中的代码

const store = configureStore(initialStateFromDB);
ReactDOM.render(
  <Provider store={store}>
    <App></App>
  </Provider>,
  document.getElementById('app')
);
const store=configureStore(initialStateFromDB);
ReactDOM.render(
,
document.getElementById('app')
);
我犯了很多错误

首先

Type 'Provider<AnyAction>' is missing the following properties from type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>[]': length, pop, push, concat, and 25 more.ts(2345)
类型“Provider”缺少类型“ReactElement ReactElement Component)>|null)|(新(props:any)=>Component)>[]中的以下属性:长度、弹出、推送、concat和25个以上。ts(2345)
第二

Conversion of type 'Store<{}, AnyAction> & { dispatch: {}; }' to type 'Provider<AnyAction>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.ts(2352)
将类型“Store&{dispatch:{};}”转换为类型“Provider”可能是错误的,因为两种类型都没有充分重叠。如果这是有意的,请首先将表达式转换为“未知”。ts(2352)
我无法理解这些错误消息的含义

我应该怎么做才能修复此错误?

OMG

我的文件名是
index.ts

我把它改成了
index.tsx


现在效果很好。

经过几个小时的努力后发现了这一点。非常感谢。