{"id":2913,"date":"2021-10-31T19:52:53","date_gmt":"2021-10-31T19:52:53","guid":{"rendered":"https:\/\/explore.techenutia.com\/2021\/10\/31\/object-is-not-a-function-reactjs\/"},"modified":"2022-12-28T15:40:36","modified_gmt":"2022-12-28T15:40:36","slug":"object-is-not-a-function-reactjs","status":"publish","type":"post","link":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/","title":{"rendered":"Object is not a function ReactJs"},"content":{"rendered":"\n<p>Sometimes while exporting components and functions in react you might face an error &#8220;Object is not a function&#8221;. The clear meaning to this error is that something in your code that you are trying to use as a function is an object. When you face this error the first thing to do is look at the line where this error occurred.<\/p>\n\n\n\n<p>Once you know which line it is look at from where you are importing the function that you are trying to call. Now in the file check if there is any default export. If there is no default export than you should look if there is any export. If there is no default export but there are exports just close the variable in curly braces while importing. Here is an example<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import {funcName} from \".\/funcfile\"<\/pre>\n\n\n\n<p>If there is default export then import it normally like this<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import funcName from \".\/funcfile\"<\/pre>\n\n\n\n<p>Comment below if you have any doubt or your question is different. I usually reply within 24hrs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes while exporting components and functions in react you might face an error &#8220;Object is not a function&#8221;. The clear meaning to this error is that something in your code that you are trying to use as a function is an object. When you face this error the first thing&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\">Read the post<span class=\"screen-reader-text\">Object is not a function ReactJs<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[479,676,807,828,914],"class_list":["post-2913","post","type-post","status-publish","format-standard","hentry","category-infinity-fitness","tag-error","tag-javascript","tag-nodejs","tag-object-error","tag-reactjs","excerpt","zoom","full-without-featured","even","excerpt-0"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.12 (Yoast SEO v26.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Object is not a function ReactJs | ManOrInfinity<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Object is not a function ReactJs\" \/>\n<meta property=\"og:description\" content=\"Sometimes while exporting components and functions in react you might face an error &#8220;Object is not a function&#8221;. The clear meaning to this error is that something in your code that you are trying to use as a function is an object. When you face this error the first thing&#8230;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\" \/>\n<meta property=\"og:site_name\" content=\"ManOrInfinity\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-31T19:52:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-28T15:40:36+00:00\" \/>\n<meta name=\"author\" content=\"manorinfinity\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@manorinfinity\" \/>\n<meta name=\"twitter:site\" content=\"@manorinfinity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"manorinfinity\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\"},\"author\":{\"name\":\"manorinfinity\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901\"},\"headline\":\"Object is not a function ReactJs\",\"datePublished\":\"2021-10-31T19:52:53+00:00\",\"dateModified\":\"2022-12-28T15:40:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\"},\"wordCount\":166,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901\"},\"keywords\":[\"error\",\"JavaScript\",\"nodejs\",\"object error\",\"reactjs\"],\"articleSection\":[\"Infinity Fitness\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\",\"url\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\",\"name\":\"Object is not a function ReactJs | ManOrInfinity\",\"isPartOf\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/#website\"},\"datePublished\":\"2021-10-31T19:52:53+00:00\",\"dateModified\":\"2022-12-28T15:40:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/manorinfinity.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Object is not a function ReactJs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/#website\",\"url\":\"https:\/\/manorinfinity.com\/blog\/\",\"name\":\"ManOrInfinity\",\"description\":\"Thrive towards greatness\",\"publisher\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/manorinfinity.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901\",\"name\":\"manorinfinity\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/manorinfinity.com\/wp-content\/uploads\/2023\/06\/moi-logo.png\",\"contentUrl\":\"http:\/\/manorinfinity.com\/wp-content\/uploads\/2023\/06\/moi-logo.png\",\"width\":282,\"height\":260,\"caption\":\"manorinfinity\"},\"logo\":{\"@id\":\"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Complex Problem Solver, Outloud Thinker, An Outstanding Writer, and a very curious human being\",\"sameAs\":[\"http:\/\/manorinfinity.com\"],\"url\":\"https:\/\/manorinfinity.com\/blog\/author\/manorinfinity\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Object is not a function ReactJs | ManOrInfinity","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/","og_locale":"en_US","og_type":"article","og_title":"Object is not a function ReactJs","og_description":"Sometimes while exporting components and functions in react you might face an error &#8220;Object is not a function&#8221;. The clear meaning to this error is that something in your code that you are trying to use as a function is an object. When you face this error the first thing&#8230;","og_url":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/","og_site_name":"ManOrInfinity","article_published_time":"2021-10-31T19:52:53+00:00","article_modified_time":"2022-12-28T15:40:36+00:00","author":"manorinfinity","twitter_card":"summary_large_image","twitter_creator":"@manorinfinity","twitter_site":"@manorinfinity","twitter_misc":{"Written by":"manorinfinity","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#article","isPartOf":{"@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/"},"author":{"name":"manorinfinity","@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901"},"headline":"Object is not a function ReactJs","datePublished":"2021-10-31T19:52:53+00:00","dateModified":"2022-12-28T15:40:36+00:00","mainEntityOfPage":{"@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/"},"wordCount":166,"commentCount":0,"publisher":{"@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901"},"keywords":["error","JavaScript","nodejs","object error","reactjs"],"articleSection":["Infinity Fitness"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/","url":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/","name":"Object is not a function ReactJs | ManOrInfinity","isPartOf":{"@id":"https:\/\/manorinfinity.com\/blog\/#website"},"datePublished":"2021-10-31T19:52:53+00:00","dateModified":"2022-12-28T15:40:36+00:00","breadcrumb":{"@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manorinfinity.com\/blog\/2021\/10\/31\/object-is-not-a-function-reactjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/manorinfinity.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Object is not a function ReactJs"}]},{"@type":"WebSite","@id":"https:\/\/manorinfinity.com\/blog\/#website","url":"https:\/\/manorinfinity.com\/blog\/","name":"ManOrInfinity","description":"Thrive towards greatness","publisher":{"@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/manorinfinity.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/1172b1895b5eb7e49cc8640e49255901","name":"manorinfinity","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/image\/","url":"http:\/\/manorinfinity.com\/wp-content\/uploads\/2023\/06\/moi-logo.png","contentUrl":"http:\/\/manorinfinity.com\/wp-content\/uploads\/2023\/06\/moi-logo.png","width":282,"height":260,"caption":"manorinfinity"},"logo":{"@id":"https:\/\/manorinfinity.com\/blog\/#\/schema\/person\/image\/"},"description":"Complex Problem Solver, Outloud Thinker, An Outstanding Writer, and a very curious human being","sameAs":["http:\/\/manorinfinity.com"],"url":"https:\/\/manorinfinity.com\/blog\/author\/manorinfinity\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/posts\/2913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/comments?post=2913"}],"version-history":[{"count":1,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/posts\/2913\/revisions"}],"predecessor-version":[{"id":3379,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/posts\/2913\/revisions\/3379"}],"wp:attachment":[{"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/media?parent=2913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/categories?post=2913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manorinfinity.com\/blog\/wp-json\/wp\/v2\/tags?post=2913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}