{"id":5255,"date":"2019-04-15T11:51:16","date_gmt":"2019-04-15T06:21:16","guid":{"rendered":"https:\/\/www.innovationm.com\/blog\/?p=5255"},"modified":"2019-04-15T11:51:16","modified_gmt":"2019-04-15T06:21:16","slug":"react-lets-hook-up","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/","title":{"rendered":"React \u2013 Let\u2019s \u201cHook\u201d up"},"content":{"rendered":"<p style=\"text-align: justify;\">With the introduction of React 16.8 in 2018, React team came up with a new concept of \u201cHooks\u201d. In this blog we are going to tell the reason behind creating hooks and also how to use them in a React application.<\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">In React, we can create two types of components namely, Functional or Stateless component and the other one is Class or Stateful component.<\/span><\/p>\n<p style=\"text-align: justify;\">Mostly, we create a class component when we have a requirement to maintain a state or to use life cycle methods in our component. But in reality, there is no actual class present in React which means classes in React are just syntactic sugar to provide resemblance with more popular OOPs classes and these class components will eventually convert to functional components.<\/p>\n<p><span style=\"font-weight: 400;\">But in order to achieve resemblance with OOPs classes, the classes in React has created more damage than the advantages it has to offer.<\/span><\/p>\n<p><b>Reasons to avoid class components and creation of Hooks: &#8211;<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Huge components hence difficult to manage and debug.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Lots of Boiler Plate is required to create a single class component.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u201cBinding\u201d and \u201cthis\u201d in class components are confusing.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Unused methods in the class component are not removed in the minified files <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Class components makes hot reloading difficult.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Class components substantially reduces compiler optimization capability.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">To overcome these impediments, React team came up with a new concept called \u201cHooks\u201d. <\/span><\/p>\n<p><b>According to React Documents,<\/b><\/p>\n<p><b>A Hook is a special function that lets you \u201chook into\u201d React features.<\/b><\/p>\n<p style=\"text-align: justify;\">The idea behind Hooks is to provide all the capabilities that we get in a class component to a functional component. The two most common capabilities of class components are state and life cycle methods. Below I have given some examples which shows how we can use hooks to achieve the two aforementioned class component capabilities.<\/p>\n<p><b>State with Hooks<\/b><\/p>\n<p><b>Example 1<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s take an example to understand how to create and use state in a functional component wit<\/span><span style=\"font-weight: 400;\">h the help of hooks : &#8211;<\/span><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-5256\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image1-300x152.png\" alt=\"\" width=\"474\" height=\"240\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image1-300x152.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image1-624x316.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image1.png 642w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In this example, we can observe a new term called \u2018useState\u2019 that we have de-structured from the react API. This useState is a hook which helps in creating a state in a stateless or functional component. <\/span><\/p>\n<p style=\"text-align: justify;\">Basically useState is a method in which we can pass argument and that argument will be treated as the default or initial value of the state variable. If we don\u2019t pass any argument than undefined will be assigned to the state variable. Here that state variable is \u2018increment\u2019. useState method returns a pair of values: the current state and the method to update it.<\/p>\n<p><span style=\"font-weight: 400;\">const [ increment, setIncrement ] \u00a0= useState(0)<\/span><\/p>\n<p style=\"text-align: justify;\">This line of code will create a state variable called increment and allocate 0 value to that variable. To assign a different value to this variable we have defined a method called \u2018setIncrement\u2019. So whenever we want to change the value of this variable we can do it only through setIncrement as we did while clicking the button.<\/p>\n<p>\u00a0<b>Example 2<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s take another example in which we will use useState more than once to create multiple state variables :-<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5258\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image2-300x283.png\" alt=\"\" width=\"409\" height=\"386\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image2-300x283.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image2-24x24.png 24w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image2.png 545w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/p>\n<p style=\"text-align: justify;\">Here in this example we are using two useState to create two separate state variables and also we have two different methods to assign new values to these state variables. In the similar fashion we can create any number of state variables using multiple useState hooks and assign them different default values and also create their separate methods to handle each one of them.<\/p>\n<p>\u00a0<b>Life cycle methods with Hooks<\/b><\/p>\n<p style=\"text-align: justify;\">To provide life cycle methods capability to functional component React provide us a hook called useEffect. useEffect hook serves the same purpose as componentDidMount, componentDidUpdate and componentWillUnmount. Let\u2019s take some example to understand the usage of useEffect hook : &#8211;<\/p>\n<p><b>Example 1<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In this example, we can observe a new term useEffect that we have de-structured from the React API. This useEffect is a hook which helps in providing componentDidMount as well as componentDidUpdate life cycle method capability to this functional component.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5260\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image3-300x223.png\" alt=\"\" width=\"420\" height=\"312\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image3-300x223.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image3.png 591w\" sizes=\"(max-width: 420px) 100vw, 420px\" \/><\/p>\n<p style=\"text-align: justify;\">Basically useEffect is a method which takes a function as an argument. In this example after the component is rendered useEffect will be called for the first time that means it is acting as the componentDidMount life cycle method and it will change the title of the document. Now, if the user clicks the button, state variable \u2018increment\u2019 value be updated and the component will be rendered again. After rendering, useEffect will be called again but this time it will act as componentDidUpdate. So now every time the component is rendered, useEffect will be called.<\/p>\n<p><b>Example 2<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Similar to useState, we can use multiple useEffect method in a single functional component. Let\u2019s take another example to explain that scenario : &#8211;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5261\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image4-300x274.png\" alt=\"\" width=\"361\" height=\"330\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image4-300x274.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/image4.png 579w\" sizes=\"(max-width: 361px) 100vw, 361px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Here in this example, we are using more than one useEffect method and both will run after each render.<\/span><\/p>\n<p><b>Example 3<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The useEffect method can take another argument of type array. This argument is used as a reference to compare current value of the variable specified in the array with the previous value of the same variable. This scenario is used to conditionally trigger the first argument of the useEffect method.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5262\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/pasted-image-0-300x288.png\" alt=\"\" width=\"376\" height=\"361\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/pasted-image-0-300x288.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/pasted-image-0-24x24.png 24w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/pasted-image-0.png 464w\" sizes=\"(max-width: 376px) 100vw, 376px\" \/><\/p>\n<p style=\"text-align: justify;\">In this example we have specified the state variable \u2018increment\u2019 as the second argument of the useEffect hook, so now the useEffect first argument will only trigger if the value of the \u2018increment\u2019 will change. When we click on the second button, state variable \u2018isValid\u2019 will change and hence component will render again but useEffect will check whether state variable \u2018increment\u2019 has changed or not and don\u2019t find any change in that so it will not execute its first argument which is a method.<\/p>\n<p><span style=\"font-weight: 400;\">There can also be multiple arguments present in the array, if any one of the array variables value changes then useEffect will be triggered.<\/span><\/p>\n<p><b>Conclusion<\/b><\/p>\n<p><span style=\"font-weight: 400;\">So from the previous examples we can conclude we are able to overcome all the impediments faced due to class components and hence in future hooks will be used in more and more React projects.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are also many advanced hooks are present in the Hooks API such as useReducer, useCallback, useMemo etc. You can learn about in depth from the React official site which is given below :-<\/span><\/p>\n<p><a href=\"https:\/\/reactjs.org\/docs\/hooks-reference.html\"><span style=\"font-weight: 400;\">https:\/\/reactjs.org\/docs\/hooks-reference.htm<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the introduction of React 16.8 in 2018, React team came up with a new concept of \u201cHooks\u201d. In this blog we are going to tell the reason behind creating hooks and also how to use them in a React application. \u00a0In React, we can create two types of components namely, Functional or Stateless component [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108,6,257,258],"tags":[343,346,247,345,344],"class_list":["post-5255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5-css-js","category-mobile-web-app","category-react","category-web-technology","tag-hooks","tag-javascript","tag-react","tag-react-hooks","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog<\/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:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"With the introduction of React 16.8 in 2018, React team came up with a new concept of \u201cHooks\u201d. In this blog we are going to tell the reason behind creating hooks and also how to use them in a React application. \u00a0In React, we can create two types of components namely, Functional or Stateless component [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-15T06:21:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1146\" \/>\n\t<meta property=\"og:image:height\" content=\"637\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"React \u2013 Let\u2019s \u201cHook\u201d up\",\"datePublished\":\"2019-04-15T06:21:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/\"},\"wordCount\":1040,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Artboard-3-1.png\",\"keywords\":[\"Hooks\",\"JavaScript\",\"react\",\"React hooks\",\"web development\"],\"articleSection\":[\"HTML5 \\\/ CSS \\\/ JS\",\"Mobile Web App\",\"React\",\"Web Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/\",\"name\":\"React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Artboard-3-1.png\",\"datePublished\":\"2019-04-15T06:21:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Artboard-3-1.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Artboard-3-1.png\",\"width\":1146,\"height\":637},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/react-lets-hook-up\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React \u2013 Let\u2019s \u201cHook\u201d up\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog","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:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/","og_locale":"en_US","og_type":"article","og_title":"React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog","og_description":"With the introduction of React 16.8 in 2018, React team came up with a new concept of \u201cHooks\u201d. In this blog we are going to tell the reason behind creating hooks and also how to use them in a React application. \u00a0In React, we can create two types of components namely, Functional or Stateless component [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/","og_site_name":"InnovationM - Blog","article_published_time":"2019-04-15T06:21:16+00:00","og_image":[{"width":1146,"height":637,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"React \u2013 Let\u2019s \u201cHook\u201d up","datePublished":"2019-04-15T06:21:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/"},"wordCount":1040,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png","keywords":["Hooks","JavaScript","react","React hooks","web development"],"articleSection":["HTML5 \/ CSS \/ JS","Mobile Web App","React","Web Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/","url":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/","name":"React \u2013 Let\u2019s \u201cHook\u201d up - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png","datePublished":"2019-04-15T06:21:16+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/04\/Artboard-3-1.png","width":1146,"height":637},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/react-lets-hook-up\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"React \u2013 Let\u2019s \u201cHook\u201d up"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/5255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=5255"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/5255\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/5268"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=5255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=5255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=5255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}