ConrabOpto / mst-query

Query library for mobx-state-tree
MIT License
110 stars 7 forks source link

QueryClientProvider error with React 18. Type '{ children: Element; }' has no properties in common #42

Closed ericklombardo closed 1 year ago

ericklombardo commented 1 year ago

I have the following error using react 18

TS2559: Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & QueryClientProviderProps.

For a temporary fix i am doing the following:

Redeclaring the type QueryClientProviderProps and include the children prop

declare type QueryClientProviderProps = {
  env?: any;
  initialData?: any;
  children: React.ReactNode;
};

Then in my code export the QueryClientProvider with the new type defined above

export QueryClientProvider const QueryClientProvider: FC<QueryClientProviderProps> = context.QueryClientProvider;
k-ode commented 1 year ago

Fixed in 2.0.7