{"id":1847,"date":"2022-10-23T13:44:43","date_gmt":"2022-10-23T13:44:43","guid":{"rendered":"https:\/\/www.antpace.com\/blog\/?p=1847"},"modified":"2025-08-25T18:00:14","modified_gmt":"2025-08-25T18:00:14","slug":"react-redux-provider-store-no-overload-matches-this-call","status":"publish","type":"post","link":"https:\/\/www.antpace.com\/blog\/react-redux-provider-store-no-overload-matches-this-call\/","title":{"rendered":"React Redux Provider Store: No Overload Matches This Call"},"content":{"rendered":"<p>This post documents a solution for the following error I encountered in a React TypeScript project that was using Redux:<\/p>\n<pre>No overload matches this call.\n  Overload 1 of 2, '(props: ProviderProps&lt;Action&gt; | Readonly&lt;ProviderProps&lt;Action&gt;&gt;): Provider&lt;Action&gt;', gave the following error.\n    Type '{ children: Element; store: Store&lt;{ readonly [$CombinedState]?: undefined; } &amp; { repos: ReposState; }, Action&gt;; }' is not assignable to type 'IntrinsicAttributes &amp; IntrinsicClassAttributes&lt;Provider&lt;Action&gt;&gt; &amp; Readonly&lt;ProviderProps&lt;Action&gt;&gt;'.\n      Property 'children' does not exist on type 'IntrinsicAttributes &amp; IntrinsicClassAttributes&lt;Provider&lt;Action&gt;&gt; &amp; Readonly&lt;ProviderProps&lt;Action&gt;&gt;'.\n  Overload 2 of 2, '(props: ProviderProps&lt;Action&gt;, context: any): Provider&lt;Action&gt;', gave the following error.\n<\/pre>\n<p>React is a JavaScript framework used to build web apps. Redux is an open-source library used to manage the state of an application, and is often used along with React JS.<\/p>\n<p>In this context, the Redux &lt;Provider&gt; component is used to pass application state along to its children components. It is best practice to wrap the entirety of your app in the &lt;Provider&gt; component, and pass the store object into it as an argument (property):<\/p>\n<pre>import React from 'react';\nimport ReactDOM from 'react-dom\/client';\nimport '.\/index.css';\nimport { Provider } from 'react-redux';\nimport App from '.\/App';\nimport { store } from '.\/state';\n\nconst root = ReactDOM.createRoot(\n  document.getElementById('root') as HTMLElement\n);\n\nroot.render(\n  &lt;React.StrictMode&gt;\n    &lt;Provider  store={store}&gt;\n      &lt;App \/&gt;\n    &lt;\/Provider&gt;\n  &lt;\/React.StrictMode&gt;\n);\n<\/pre>\n<p>In my project, this was producing an error on the &lt;Provider&gt; component that said &#8220;No overload matches this call.&#8221; I knew this must have something to with the argument(s) being passed along.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1849\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/04\/No-overload-matches-this-call..png\" alt=\"No overload matches this call.\" width=\"906\" height=\"540\" \/><\/p>\n<p>At first I thought it might have something to do with my store object, but that was not it. I was able to resolve this roadblock by explicitly passing a <span style=\"font-size: 1rem;\">ProviderProps object into the Provider component.<\/span><\/p>\n<pre>import React from 'react';\nimport ReactDOM from 'react-dom\/client';\nimport '.\/index.css';\nimport { Provider, ProviderProps } from 'react-redux';\nimport App from '.\/App';\nimport { store } from '.\/state';\n\n\nconst providerProps: ProviderProps = {\n  store: store,\n};\n\nconst root = ReactDOM.createRoot(\n  document.getElementById('root') as HTMLElement\n);\n\nroot.render(\n  &lt;React.StrictMode&gt;\n    &lt;Provider  {...providerProps}&gt;\n      &lt;App \/&gt;\n    &lt;\/Provider&gt;\n  &lt;\/React.StrictMode&gt;\n);\n\n<\/pre>\n<p>This worked because the <code>store<\/code>\u00a0object is explicitly typed in the ProviderProps object. This ensures that it\u00a0matches the type expected by the <code>Provider<\/code> component. Ultimately, it was a TypeScript error. TypeScript was not able to infer the <code>store<\/code> type correctly.<\/p>\n<p>This was a bug I encountered while building a web app for an <a href=\"https:\/\/www.udemy.com\/course\/react-and-typescript-build-a-portfolio-project\/\" target=\"_blank\" rel=\"noopener\">Udemy course called &#8220;React and Typescript: Build a Portfolio Project<\/a>&#8220;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post documents a solution for the following error I encountered in a React TypeScript project that was using Redux: No overload matches this call. Overload 1 of 2, &#8216;(props: ProviderProps&lt;Action&gt; | Readonly&lt;ProviderProps&lt;Action&gt;&gt;): Provider&lt;Action&gt;&#8217;, gave the following error. Type &#8216;{ children: Element; store: Store&lt;{ readonly [$CombinedState]?: undefined; } &amp; { repos: ReposState; }, Action&gt;; }&#8217; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.antpace.com\/blog\/react-redux-provider-store-no-overload-matches-this-call\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;React Redux Provider Store: No Overload Matches This Call&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3253,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[71,104,107,132],"class_list":["post-1847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-javascript","tag-react","tag-redux","tag-typescript"],"_links":{"self":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/1847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/comments?post=1847"}],"version-history":[{"count":1,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/1847\/revisions"}],"predecessor-version":[{"id":3254,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/1847\/revisions\/3254"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media?parent=1847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/categories?post=1847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/tags?post=1847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}