{"id":96448,"date":"2019-09-02T19:00:46","date_gmt":"2019-09-02T16:00:46","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=96448"},"modified":"2019-08-29T16:03:27","modified_gmt":"2019-08-29T13:03:27","slug":"reactjs-hide-component-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html","title":{"rendered":"ReactJS Hide Component Example"},"content":{"rendered":"<p>ReactJS is one of the most popular JavaScript libraries today. In this article, we take a look at how to hide a ReactJS component. There are a couple of ways to achieve this. We will look at each method and walk through its implementation in this article.<\/p>\n<p>For the example that we will build, I have used the following stack of tools and libraries. Some are optional and can be replaced with your favorites like the  IDE yet others are mandatory.<\/p>\n<ol class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" aria-label=\"Visual Studio Code IDE (opens in a new tab)\" href=\"https:\/\/code.visualstudio.com\" target=\"_blank\">Visual Studio Code IDE<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/create-react-app\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Create React App Package (opens in a new tab)\">Create React App Package<\/a><\/li>\n<\/ol>\n<p>Visual Studio Code IDE is my personal preference when working with, specifically, the front-end of an application. You are free to use another editor of your own choice. The create react app package let&#8217;s quickly scaffold the structure of a starting point. It sets up things that would otherwise involve efforts and divert us from the task at hand. <\/p>\n<p>Let us create a skeletal ReactJS application using create-react-app. We achieve the same using the following command:<\/p>\n<pre class=\"brush: bash;\">&gt; npx create-react-app my-app .<\/pre>\n<p>The <code>npx<\/code> command downloads the create-react-app package and runs it using the arguments provided. Once done it disposes of the package. This prevents polluting our global namespace with rarely used packages. The newly created project has a structure similar to the following screenshot.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"327\" height=\"808\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutputReactJSHideComponent.jpg\" alt=\"ReactJS Hide Component - Project Structure\" class=\"wp-image-96903\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutputReactJSHideComponent.jpg 327w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutputReactJSHideComponent-121x300.jpg 121w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><figcaption>Project Structure<\/figcaption><\/figure>\n<\/div>\n<p>There are two ways to go about achieving our aim in this article. One is to not render the component itself and the other is to hide it using CSS. Let us look at both approaches one at a time.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2 class=\"wp-block-heading\">1. Conditional Rendering<\/h2>\n<p>In this approach, we apply logic in the render method of the component to conditionally render or not the component in question. Let us say we create a component that displays a greeting message to the user. Additionally, we render a checkbox which when checked displays the greeting and hides it when unchecked. To achieve this behavior we store the state of the checkbox in the state of the component. <\/p>\n<p>When the render method is called we use the following expression in the return value of the render method.<\/p>\n<pre class=\"brush: js;\">...\nthis.state.show &amp;&amp; &lt;Greeting \/&gt;;\n...\n<\/pre>\n<p>This expression returns the second value if the first value is true and false otherwise. Used in the render method this ensures that the component is not rendered when the value of the show state variable is false. The implementation code looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Greeting.tsx<\/em><\/span><\/p>\n<pre class=\"brush: js;\">import React from 'react';\ntype myprops = {};\ntype mystate = { greeting: string, show: boolean};\nclass Greeting extends React.Component {\n    constructor(props: any) {\n        super(props);\n        this.state = {\n            greeting: 'Hello from JavaCodeGeeks',\n            show: true\n        };\n    }\n    render = () =&gt; {\n        \n        return  (&lt;div&gt;&lt;input type=\"checkbox\" checked={this.state.show} onChange={this.onChange} \/&gt;&lt;span&gt;Show Greeting&lt;\/span&gt;\n            {this.state.show &amp;&amp; &lt;h3&gt;{this.state.greeting}&lt;\/h3&gt;}\n        &lt;\/div&gt;);\n    }\n    onChange = (e: any) =&gt; {\n        this.setState({show: e.target.checked});\n    }\n}\nexport default Greeting;\n\n<\/pre>\n<p>When we run this code using the command npm start and navigate to the URL http:\/\/localhost:3000 in the browser. We see the below output:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"602\" height=\"217\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Project-Output.jpg\" alt=\"ReactJS Hide Component - Project Output\" class=\"wp-image-96910\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Project-Output.jpg 602w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/Project-Output-300x108.jpg 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><figcaption>Project Output<\/figcaption><\/figure>\n<\/div>\n<p>On unchecking the checkbox the greeting text disappears completely like below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"375\" height=\"220\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-1.jpg\" alt=\"ReactJS Hide Component - Project Output\" class=\"wp-image-96911\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-1.jpg 375w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-1-300x176.jpg 300w\" sizes=\"(max-width: 375px) 100vw, 375px\" \/><figcaption>Project Output<\/figcaption><\/figure>\n<\/div>\n<p>Now we take a look at the other approach I mentioned above to achieve the same functionality.<\/p>\n<h2 class=\"wp-block-heading\">2. CSS Rules<\/h2>\n<p>We can show\/hide a component using the CSS rule display, by setting it to none or block. To formulate an approach to show\/hide our component we create a CSS style class which when applied to the component hides it. The component is visible otherwise. Our code revolves around setting the className property on the component. The code snippet for which looks like below:<\/p>\n<pre class=\"brush: js;\">&lt;Greeting className={this.state.show ? '': 'hide'} \/&gt;\n<\/pre>\n<p>This CSS hide class looks like below:<\/p>\n<pre class=\"brush: css:\">.hide {\n    display: none;\n}<\/pre>\n<p>So now we set the show property to false when the checkbox is unchecked and the hide class is applied to our component. Which hides it from view completely. The complete implementation code looks like below with both approaches included:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Greeting.tsx<\/em><\/span><\/p>\n<pre class=\"brush:js;\">import React from 'react';\ntype myprops = {};\ntype mystate = { greeting: string, show: boolean};\nclass Greeting extends React.Component {\n    constructor(props: any) {\n        super(props);\n        this.state = {\n            greeting: 'Hello from JavaCodeGeeks',\n            show: true\n        };\n    }\n    render = () =&gt; {\n        return  (&lt;div&gt;&lt;input type=\"checkbox\" checked={this.state.show} onChange={this.onChange} \/&gt;&lt;span&gt;Show Greeting&lt;\/span&gt;\n            {this.state.show &amp;&amp; &lt;h3&gt;{this.state.greeting}&lt;\/h3&gt;}\n            &lt;h3 className={this.state.show ? '':'hide'}&gt;{this.state.greeting}&lt;\/h3&gt;\n        &lt;\/div&gt;);\n    }\n    onChange = (e: any) =&gt; {\n        this.setState({show: e.target.checked});\n    }\n}\nexport default Greeting;\n\n<\/pre>\n<p>Now when we run the code and navigate to it in the browser we see the below output.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"597\" height=\"261\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-3.jpg\" alt=\"\" class=\"wp-image-96918\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-3.jpg 597w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/ProjectOutput-3-300x131.jpg 300w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><figcaption>Project Output<\/figcaption><\/figure>\n<\/div>\n<p>This wraps up our look at ReactJS Hiding Component feature example.<\/p>\n<h2 class=\"wp-block-heading\">3. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/08\/JCG-ReactJS-Hide-Component-Example.zip\"><strong>ReactJS Hide Component Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>ReactJS is one of the most popular JavaScript libraries today. In this article, we take a look at how to hide a ReactJS component. There are a couple of ways to achieve this. We will look at each method and walk through its implementation in this article. For the example that we will build, I &hellip;<\/p>\n","protected":false},"author":82952,"featured_media":92051,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1903],"tags":[1919],"class_list":["post-96448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-js","tag-reactjs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ReactJS Hide Component Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!\" \/>\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.javacodegeeks.com\/reactjs-hide-component-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ReactJS Hide Component Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-02T16:00:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\"},\"headline\":\"ReactJS Hide Component Example\",\"datePublished\":\"2019-09-02T16:00:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html\"},\"wordCount\":615,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"keywords\":[\"Reactjs\"],\"articleSection\":[\"React.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html\",\"name\":\"ReactJS Hide Component Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"datePublished\":\"2019-09-02T16:00:46+00:00\",\"description\":\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-hide-component-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"React.js\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\\\/react-js\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"ReactJS Hide Component Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/siddharth-seth-240180\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/siddharth_seth1980\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ReactJS Hide Component Example - Java Code Geeks","description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!","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.javacodegeeks.com\/reactjs-hide-component-example.html","og_locale":"en_US","og_type":"article","og_title":"ReactJS Hide Component Example - Java Code Geeks","og_description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!","og_url":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-09-02T16:00:46+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c"},"headline":"ReactJS Hide Component Example","datePublished":"2019-09-02T16:00:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html"},"wordCount":615,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","keywords":["Reactjs"],"articleSection":["React.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html","url":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html","name":"ReactJS Hide Component Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","datePublished":"2019-09-02T16:00:46+00:00","description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Hide Component!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/reactjs-hide-component-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"JavaScript","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript"},{"@type":"ListItem","position":4,"name":"React.js","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript\/react-js"},{"@type":"ListItem","position":5,"name":"ReactJS Hide Component Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.linkedin.com\/in\/siddharth-seth-240180\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/siddharth_seth1980"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/96448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/82952"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=96448"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/96448\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/92051"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=96448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=96448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=96448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}