{"id":2307,"date":"2022-01-26T10:03:50","date_gmt":"2022-01-26T10:03:50","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=2307"},"modified":"2022-01-26T10:03:51","modified_gmt":"2022-01-26T10:03:51","slug":"react-hooks-for-beginners","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=2307","title":{"rendered":"React Hooks for Beginners"},"content":{"rendered":"\n<h2>What are Hooks<\/h2>\n\n\n\n<p>React hooks are like Anchor ( same as what ships drop in the ocean to attach the ship and ocean floor) between React state (ocean floor) and life-cycle features ( ship ) of functional components.<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul><li>Only work with function based components, not with class based components.<\/li><li>Both arrow and regular function component works<\/li><li>Cannot nest hooks inside loops, conditions or nested functions<\/li><\/ul>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usestate-endraw-\"><\/a> <code>useState()<\/code><\/h2>\n\n\n\n<p><code>useState<\/code> hook provides you with functionality to set state for a variable and automatically update the DOM with the new state<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--A7Jwp7ok--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/jsl13pstnw6e3sqn9exk.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--A7Jwp7ok--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/jsl13pstnw6e3sqn9exk.png\" alt=\"setState\"\/><\/a><\/figure>\n\n\n\n<h3><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#how-to-import-\"><\/a> how to import :<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, {useState} from \"react\";\n\/\/ or \nReact.useState;\n<\/code><\/pre>\n\n\n\n<h3><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#example-raw-usestate-endraw-\"><\/a> example <code>useState<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState } from 'react'\n\nlet count1 = 0;\n\nfunction App() {\n\n  const &#91;count, setCount] = useState(0);\n\n  let count2 = 0;\n\n  return (\n    &lt;div className='container mt-3'&gt;\n      &lt;h3&gt;Hello World to React Hooks&lt;\/h3&gt;\n\n      &lt;h4&gt;Count : {count}&lt;\/h4&gt;\n      &lt;h4&gt;Count1 : {count1}&lt;\/h4&gt;\n      &lt;h4&gt;Count2 : {count2}&lt;\/h4&gt;\n\n      &lt;button className='btn btn-info' onClick={() =&gt; {\n        setCount(count + 1);\n\n        console.log(`count : ${count} | count1 : ${count1}  count2 :${count2}`);\n\n        count1 = count1 + 1;\n        count2 = count2 + 1;\n      }} &gt;Add here&lt;\/button&gt;\n    &lt;\/div&gt;\n  )\n}\n\nexport default App\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--tksMUwcg--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/3g145sn0y75qvcvx4dkl.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--tksMUwcg--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/3g145sn0y75qvcvx4dkl.png\" alt=\"react_setState\"\/><\/a><\/figure>\n\n\n\n<p>In this code snippet, <code>count<\/code> and <code>count1<\/code> will be updated both as variable as well in <code>DOM<\/code>. But <code>count2<\/code> will always be 1 (because of +1 operation in <code>button.onClick<\/code> ) as whenever any data is changed in a react component, the whole component is re rendered. This is the reason why components exists.<\/p>\n\n\n\n<p>Now you may ask, we can declare variables in global state and not use <code>useState<\/code>. Well declaring global variables in all programming languages are considered as bad practice except for some cases. Refer :<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/www.tutorialspoint.com\/why-are-global-variables-bad-in-c-cplusplus\">https:\/\/www.tutorialspoint.com\/why-are-global-variables-bad-in-c-cplusplus<\/a><\/li><li><a href=\"https:\/\/dev.to\/mervinsv\/why-global-variables-are-bad-4pj\">https:\/\/dev.to\/mervinsv\/why-global-variables-are-bad-4pj<\/a><\/li><\/ul>\n\n\n\n<p><code>useState<\/code> provides a consistent state without even if the component re renders.<\/p>\n\n\n\n<h3><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usestate-endraw-for-objects\"><\/a> <code>useState<\/code> for objects<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState } from 'react'\n\nfunction App() {\n\n  const &#91;{ counter1, counter2 }, setCounter] = useState({ counter1: 0, counter2: 20 })\n\n  return (\n    &lt;div className='container mt-3'&gt;\n      &lt;div className='container'&gt;\n\n        &lt;h3&gt;Counter1 : {counter1}&lt;\/h3&gt;\n        &lt;h3&gt;Counter2 : {counter2}&lt;\/h3&gt;\n\n{\/* this doesnt not work becuz whenever you update state, you need to update the whole object *\/}\n{\/* Over here, we havent included the counter2 in the setCounter function. *\/}\n\n        &lt;button className=\"btn btn-primary\" onClick={() =&gt;\n          setCounter(currentState =&gt; ({ counter1: currentState.counter1 + 1 }))}&gt;Add&lt;\/button&gt; &amp;nbsp;\n\n{\/* this will also not work because spread operator in objects comes first \n    unlike in functions, where spread operator comes last. *\/}\n\n{\/* Correct Code *\/}\n                &lt;button className=\"btn btn-danger\" onClick={() =&gt; setCounter(currentState =&gt; ({\n          ...currentState,          \n          counter1: currentState.counter1 - 1,\n        }))}&gt;Subtract&lt;\/button\n\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  )\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<h3><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#another-example-raw-usestate-endraw-\"><\/a> Another Example <code>useState()<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState } from \"react\";\n\nfunction App() {\n\n  const &#91;name, setName] = useState(localStorage.getItem(\"name\") || \"\");\n\n  return (\n    &lt;div className=\"App\"&gt;\n\n      &lt;div className=\"container mt-3\"&gt;\n        &lt;input name=\"name\" value={name} onChange={e =&gt; {\n          setName(e.target.value)\n          localStorage.setItem(\"name\", e.target.value)\n        }} className='form-control' \/&gt;\n\n        &lt;h3&gt;Name : {name}&lt;\/h3&gt;\n      &lt;\/div&gt;\n\n    &lt;\/div &gt;\n  );\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-useeffect-endraw-\"><\/a> <code>useEffect()<\/code><\/h2>\n\n\n\n<ul><li>executes every time a component is rendered<\/li><li><code>useEffect<\/code> when passed no dependency works as <code>componentDidMount<\/code><\/li><li>return arrow function from <code>useEffect<\/code> is a clean up function<\/li><li>many <code>useEffect<\/code> hook can co exists in one component<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState, useEffect } from \"react\";\nimport HelloWorld from \".\/component\/HelloWorld\";\n\nfunction App() {\n\n  const &#91;count, setCount] = useState(0);\n  const &#91;showComp, setComp] = useState(false);\n\n  useEffect(() =&gt; {\n    console.log(\"Rendering ...\")\n  })\n\n  return (\n    &lt;div className=\"App\"&gt;\n\n      &lt;br \/&gt;\n\n      &lt;div className='container mt-3'&gt;\n        &lt;h3&gt;Count : {count}&lt;\/h3&gt;\n        &lt;button className=\"btn btn-primary\" onClick={() =&gt; setCount(count + 1)}&gt;Add&lt;\/button&gt; &amp;nbsp;\n      &lt;\/div&gt;\n\n      &lt;br \/&gt;\n\n      &lt;div className='container'&gt;\n        &lt;button onClick={() =&gt; setComp(!showComp)} className=\"btn btn-info\"&gt; toggle &lt;\/button&gt;\n        {showComp &amp;&amp; &lt;HelloWorld \/&gt;}\n      &lt;\/div&gt;\n\n    &lt;\/div &gt;\n  );\n}\n\nexport default App;\n\n\/\/ in src\/component\/HelloWorld.jsx\n\nimport React from 'react'\n\nfunction HelloWorld() {\n    return (\n        &lt;div className='container mt-3'&gt;\n            &lt;h2&gt;HelloWorld component&lt;\/h2&gt;\n        &lt;\/div&gt;\n    )\n}\n\nexport default HelloWorld\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--274EAbVG--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/1f4yu1galcj5knjmza21.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--274EAbVG--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/1f4yu1galcj5knjmza21.png\" alt=\"useEffect\"\/><\/a><\/figure>\n\n\n\n<p>Run the code and look at the console &#8230; Doesn&#8217;t matter whether you increment the counter or toggle the component, the whole component get re-render.<\/p>\n\n\n\n<p>To Stop this, modify <code>useEffect<\/code> as following<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>useEffect(() =&gt; {\n    console.log(\"Rendering ...\")\n}, &#91;])\n<\/code><\/pre>\n\n\n\n<p>Now the rendering will print on the console only when you refresh the page. Try modifying code as following<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>useEffect(() =&gt; {\n    console.log(\"Rendering ...\")\n}, &#91;count])\n<\/code><\/pre>\n\n\n\n<p>Now the component will re render only when count is updated<\/p>\n\n\n\n<p>This is what <code>useEffect<\/code> do, to only update \/ rendering the component when required. There is also a way to clean up the component. Try by modifying <code>HelloWorld.jsx<\/code><br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from 'react'\n\nfunction HelloWorld() {\n\n    React.useEffect(() =&gt; {\n        console.log('HelloWorld')\n        return () =&gt; {\n            console.log('GoodByeWorld')\n        }\n    }, &#91;])\n\n    return (\n        &lt;div className='container mt-3'&gt;\n            &lt;h2&gt;HelloWorld component&lt;\/h2&gt;\n        &lt;\/div&gt;\n    )\n}\n\nexport default HelloWorld\n\n\/\/ and App.jsx\n\nuseEffect(() =&gt; {\n    console.log(\"Rendering ...\")\n},&#91;])\n<\/code><\/pre>\n\n\n\n<p>Now try to toggle switch, you the message with the component is loaded on <code>DOM<\/code> and when its <code>unmounting<\/code>. This works similiar to <strong><code>componentWillMount<\/code> and <code>componentWillUnmount<\/code><\/strong><\/p>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-useref-endraw-\"><\/a> <code>useRef<\/code><\/h2>\n\n\n\n<p>When you simply wants to put some html element or react component to focus<\/p>\n\n\n\n<p>Best try running this code<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useRef } from \"react\";\n\nfunction App() {\n\n  const inputRef = useRef();\n\n  return (\n    &lt;div className=\"App\"&gt;\n\n      &lt;div className=\"container mt-3\"&gt;\n\n        &lt;input ref={inputRef} name=\"name\" value={name} onChange={e =&gt; {\n          setName(e.target.value)\n          localStorage.setItem(\"name\", e.target.value)\n        }}\n          className='form-control'\n        \/&gt;\n\n        &lt;br \/&gt;\n\n        &lt;button onClick={() =&gt; {\n          inputRef.current.focus();\n        }} className=\"btn btn-success\" &gt;Get focus&lt;\/button&gt;\n\n      &lt;\/div&gt;\n\n    &lt;\/div&gt;\n  );\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--Eo24E5Ot--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/mr9mutxul332jtv8z55h.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--Eo24E5Ot--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/mr9mutxul332jtv8z55h.png\" alt=\"useref\"\/><\/a><\/figure>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usereducer-endraw-\"><\/a> <code>useReducer<\/code><\/h2>\n\n\n\n<p>Diagram explains this hook the best<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--LnOvU1Gb--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z2xe778c8wmq6ky87puw.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--LnOvU1Gb--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z2xe778c8wmq6ky87puw.png\" alt=\"userReducer\"\/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useReducer } from \"react\";\n\nfunction reducer(state, action) {\n  switch (action.type) {\n    case 'increment': return state + 1;\n    case 'decrement': return state - 1;\n    default: return state;\n  }\n}\n\nfunction App() {\n\n  const &#91;count, dispatch] = useReducer(reducer, 0);\n\n  return (\n    &lt;div className=\"App\"&gt;\n\n      &lt;div className='container' &gt;\n        &lt;h2&gt; count : {count} &lt;\/h2&gt;\n        &lt;button onClick={() =&gt; dispatch({ type: 'increment' })} className='btn btn-primary' &gt; increment &lt;\/button&gt;\n        &lt;button onClick={() =&gt; dispatch({ type: 'decrement' })} className='btn btn-danger' &gt; increment &lt;\/button&gt;\n\n      &lt;\/div&gt;\n\n    &lt;\/div &gt;\n  );\n}\n\nexport default App;\n<\/code><\/pre>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usecontext-endraw-\"><\/a> <code>useContext<\/code><\/h2>\n\n\n\n<p>Diagram explains this hook the best<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--4-90U6vt--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/89igrqius1z6koje75ab.png\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--4-90U6vt--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/89igrqius1z6koje75ab.png\" alt=\"useContext\"\/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ App.js\nimport React from 'react'\nimport HelloWorld from \".\/components\/HelloWorld\"\nimport About from '.\/component\/About'\nimport { UserContext } from '.\/UserContext'\n\nfunction App() {\n  return (\n    &lt;div&gt;\n      &lt;UserContext.Provider value='super man'&gt;\n        &lt;HelloWorld \/&gt;\n      &lt;\/UserContext.Provider&gt;\n    &lt;\/div&gt;\n  )\n}\n\nexport default App\n\n\/\/ Hello World component\n\nimport React, { useContext } from 'react'\nimport { UserContext } from '..\/UserContext'\n\nfunction HelloWorld() {\n\n    const msg = useContext(UserContext);\n\n    return (\n        &lt;div className='container mt-3'&gt;\n            &lt;h3&gt;HelloWorld component : {msg}&lt;\/h3&gt;\n        &lt;\/div&gt;\n    )\n}\n\nexport default HelloWorld\n\n\/\/ About component\n\nimport React, { useContext } from 'react'\nimport { UserContext } from '..\/UserContext'\n\nfunction About() {\n\n    const msg = useContext(UserContext);\n\n    return (\n        &lt;div className='container mt-3'&gt;\n            &lt;h3&gt;About component : {msg}&lt;\/h3&gt;\n        &lt;\/div&gt;\n    )\n}\n\nexport default About\n\n\/\/ Usercontext.js \n\nimport { createContext } from \"react\";\n\nexport const UserContext = createContext(null);\n<\/code><\/pre>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usememo-endraw-\"><\/a> <code>useMemo<\/code><\/h2>\n\n\n\n<p>Memo or Memoization is when you remember the result on something instead of computing it again and again when needed (until not changed)<\/p>\n\n\n\n<p><code>useMemo<\/code> in react is used for functions that are expensive and we dont want them to run again and again. It is similar to <code>useEffect<\/code> hook but used more for functions, whereas useEffect is used as managing state in component lifecycle, even tho they are very similiar.<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from 'react'\n\nfunction expensivePhoneFunc (product) {\n  console.log(\"expensivePhoneFunc\")\n  return product&#91;0];\n}\n\nfunction App() {\n\n  let product = &#91;{\n    name: 'Phone XL',\n    price: 100\n  },\n  {\n    name: 'Phone Mini',\n    price: 80\n  },\n  {\n    name: 'Phone Standard',\n    price: 60\n  }]\n\n  const &#91;count , setCount] = React.useState(0);\n\n  const expensivePhone = React.useMemo( () =&gt; {\n    return expensivePhoneFunc(product);\n  },&#91;])\n\n  return (\n    &lt;div className='container mt-3'&gt;\n      &lt;h3&gt;Product : {expensivePhone.name}&lt;\/h3&gt;\n      &lt;h4&gt;Price : {expensivePhone.price}&lt;\/h4&gt;\n      &lt;br \/&gt;\n      &lt;h3&gt;Count : {count}&lt;\/h3&gt;\n      &lt;button className='btn btn-primary' onClick={() =&gt; setCount(count + 1)}&gt;+&lt;\/button&gt;\n    &lt;\/div&gt;\n  )\n}\n\nexport default App\n<\/code><\/pre>\n\n\n\n<h2><a href=\"https:\/\/dev.to\/dev117uday\/react-hooks-0-to-hero-4b7o#-raw-usecallback-endraw-\"><\/a> <code>useCallback<\/code><\/h2>\n\n\n\n<p>It is the <code>useMemo<\/code> alternative but for functions, rather than the result returned from them. Instead of running the function again and again. Its is mostly used along with useMemo.<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, {useCallback} from 'react'\nimport HelloWorld from '.\/component\/HelloWorld'\n\nfunction App() {\n\n  const &#91;count, setCount] = React.useState(0);\n\n  const increment = useCallback(() =&gt; {\n    setCount(c =&gt; c + 1);\n  }, &#91;setCount]);\n\n\n  return (\n    &lt;div&gt;\n      &lt;HelloWorld increment={increment} \/&gt;\n      &lt;h3&gt;Count : {count}&lt;\/h3&gt;\n    &lt;\/div&gt;\n  )\n}\n\nexport default App\n\n\/\/ HelloWorld.jsx\n\nimport React from 'react'\n\nconst HelloWorld = React.memo(({ increment }) =&gt; {\n\n    console.log(\"hello\")\n\n    return (\n        &lt;div className='container mt-3'&gt;\n            &lt;h3&gt;HelloWorld component&lt;\/h3&gt;\n            &lt;button onClick={increment}&gt;Hello World&lt;\/button&gt;\n        &lt;\/div&gt;\n    )\n})\n\nexport default HelloWorld\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What are Hooks React hooks are like Anchor ( same as what ships drop in the ocean to attach the ship and ocean floor) between React state (ocean floor) and life-cycle features ( ship ) of functional components.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[65,140],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2307"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2307"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2307\/revisions"}],"predecessor-version":[{"id":2308,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2307\/revisions\/2308"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}