首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >StoreProvider返回错误“属性‘’子‘不存在类型.”

StoreProvider返回错误“属性‘’子‘不存在类型.”
EN

Stack Overflow用户
提问于 2022-04-29 09:02:38
回答 1查看 511关注 0票数 1

我在上发现了这个错误,为什么?孩子们有什么问题吗?

代码语言:javascript
复制
TS2769: No overload matches this call.
  Overload 1 of 2, '(props: { store: Store<StoreModel, EasyPeasyConfig<undefined, {}>>; } | Readonly<{ store: Store<StoreModel, EasyPeasyConfig<undefined, {}>>; }>): StoreProvider<...>', gave the following error.
    Type '{ children: Element; store: Store<StoreModel, EasyPeasyConfig<undefined, {}>>; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<StoreProvider<StoreModel>> & Readonly<{ store: Store<StoreModel, EasyPeasyConfig<...>>; }>'.
      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<StoreProvider<StoreModel>> & Readonly<{ store: Store<StoreModel, EasyPeasyConfig<...>>; }>'.
  Overload 2 of 2, '(props: { store: Store<StoreModel, EasyPeasyConfig<undefined, {}>>; }, context: any): StoreProvider<StoreModel>', gave the following error.
    Type '{ children: Element; store: Store<StoreModel, EasyPeasyConfig<undefined, {}>>; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<StoreProvider<StoreModel>> & Readonly<{ store: Store<StoreModel, EasyPeasyConfig<...>>; }>'.
      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<StoreProvider<StoreModel>> & Readonly<{ store: Store<StoreModel, EasyPeasyConfig<...>>; }>'.
代码语言:javascript
复制
import { StoreProvider } from 'easy-peasy';
import store from './store';
...
root.render(
  <React.StrictMode>
    <StoreProvider store={store}>
      <ApolloProvider client={client}>
        <BrowserRouter>
          <App />
        </BrowserRouter>
      </ApolloProvider>
    </StoreProvider>
  </React.StrictMode>
);

商店:

代码语言:javascript
复制
import { createStore } from 'easy-peasy';
import { storeModel } from './model';

const store = createStore(storeModel);

export default store;

EN

回答 1

Stack Overflow用户

发布于 2022-04-29 10:48:32

我在这里找到了答案:

https://github.com/ctrlplusb/easy-peasy/issues/741

这是反应18的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72055436

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档