{"id":568,"date":"2022-08-08T15:18:09","date_gmt":"2022-08-08T07:18:09","guid":{"rendered":"https:\/\/www.tonghin.com.my\/blog\/?p=568"},"modified":"2022-08-08T15:18:27","modified_gmt":"2022-08-08T07:18:27","slug":"check-box-react-native","status":"publish","type":"post","link":"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/","title":{"rendered":"Check Box For React Native"},"content":{"rendered":"\n<p>I had made a new screen the week before.<\/p>\n\n\n\n<p>The user must choose the warehouse that he is currently in on the new screen, which appeared right after logging in.<\/p>\n\n\n\n<p>So\u00a0I\u00a0created\u00a0a\u00a0checkbox\u00a0for\u00a0react\u00a0native\u00a0paper\u00a0where\u00a0the\u00a0status\u00a0should\u00a0have\u00a0been\u00a0checked\u00a0or\u00a0unchecked\u00a0on\u00a0that\u00a0screen.\u00a0So,\u00a0when\u00a0I\u00a0had\u00a0located\u00a0the\u00a0warehouse&#8217;s\u00a0data,\u00a0I\u00a0mapped\u00a0a\u00a0new\u00a0feature\u00a0to\u00a0it\u00a0called\u00a0isChecked\u00a0with type Boolean and\u00a0set\u00a0it\u00a0to\u00a0false. <br>Next,\u00a0I\u00a0created\u00a0a\u00a0function\u00a0called\u00a0handle\u00a0function\u00a0that\u00a0accepts\u00a0an\u00a0id\u00a0parameter\u00a0and\u00a0has\u00a0a\u00a0condition\u00a0that,\u00a0if\u00a0true,\u00a0changes\u00a0the\u00a0value\u00a0of\u00a0isChecked\u00a0to\u00a0the\u00a0opposite\u00a0value.\u00a0Thus,\u00a0alter\u00a0it\u00a0from\u00a0true\u00a0to\u00a0false\u00a0if\u00a0it\u00a0was\u00a0true,\u00a0and\u00a0vice\u00a0versa\u00a0if\u00a0it\u00a0was\u00a0false.<\/p>\n\n\n\n<p>When&nbsp;I&nbsp;no&nbsp;longer&nbsp;needed&nbsp;to&nbsp;use&nbsp;that&nbsp;screen,&nbsp;I&nbsp;didn&#8217;t&nbsp;want&nbsp;to&nbsp;keep&nbsp;it&nbsp;on&nbsp;the&nbsp;navigator&nbsp;and&nbsp;be&nbsp;able&nbsp;to&nbsp;find&nbsp;it&nbsp;by&nbsp;pressing&nbsp;the&nbsp;back&nbsp;button,&nbsp;so&nbsp;I&nbsp;destroyed&nbsp;the&nbsp;screen.&nbsp;They&nbsp;will&nbsp;only&nbsp;be&nbsp;able&nbsp;to&nbsp;call&nbsp;again&nbsp;through&nbsp;the&nbsp;button&nbsp;to&nbsp;change,&nbsp;and&nbsp;then&nbsp;I&nbsp;destroyed&nbsp;it&nbsp;once&nbsp;more.&nbsp;I&nbsp;made&nbsp;all&nbsp;of&nbsp;that&nbsp;in&nbsp;order&nbsp;to&nbsp;use&nbsp;multi-selection;&nbsp;if&nbsp;it&nbsp;were&nbsp;single&nbsp;selection&nbsp;only,&nbsp;it&nbsp;wouldn&#8217;t&nbsp;be&nbsp;as&nbsp;complicated.<\/p>\n\n\n\n<p>I\u00a0also\u00a0work\u00a0on\u00a0the\u00a0docker\u00a0registry,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0to\u00a0complete\u00a0the\u00a0assignment\u00a0that\u00a0Mr.\u00a0Peter\u00a0assigned\u00a0me\u00a0because\u00a0I\u00a0was\u00a0still\u00a0struggling\u00a0with\u00a0the\u00a0SSL.\u00a0I\u00a0also\u00a0generated\u00a0a\u00a0SalesApi\u00a0using\u00a0a\u00a0different\u00a0generator,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0 to\u00a0utilise\u00a0it.\u00a0I\u00a0am\u00a0still\u00a0searching\u00a0for\u00a0examples\u00a0of\u00a0how\u00a0to\u00a0use\u00a0that\u00a0to\u00a0resolve \u00a0the\u00a0problem\u00a0with\u00a0the\u00a0format\u00a0of\u00a0the\u00a0array\u00a0when\u00a0submitting\u00a0the\u00a0warehouses.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had made a new screen the week before. The user must choose the warehouse that he is currently in on the new screen, which appeared right after logging in. So\u00a0I\u00a0created\u00a0a\u00a0checkbox\u00a0for\u00a0react\u00a0native\u00a0paper\u00a0where\u00a0the\u00a0status\u00a0should\u00a0have\u00a0been\u00a0checked\u00a0or\u00a0unchecked\u00a0on\u00a0that\u00a0screen.\u00a0So,\u00a0when\u00a0I\u00a0had\u00a0located\u00a0the\u00a0warehouse&#8217;s\u00a0data,\u00a0I\u00a0mapped\u00a0a\u00a0new\u00a0feature\u00a0to\u00a0it\u00a0called\u00a0isChecked\u00a0with type Boolean and\u00a0set\u00a0it\u00a0to\u00a0false. Next,\u00a0I\u00a0created\u00a0a\u00a0function\u00a0called\u00a0handle\u00a0function\u00a0that\u00a0accepts\u00a0an\u00a0id\u00a0parameter\u00a0and\u00a0has\u00a0a\u00a0condition\u00a0that,\u00a0if\u00a0true,\u00a0changes\u00a0the\u00a0value\u00a0of\u00a0isChecked\u00a0to\u00a0the\u00a0opposite\u00a0value.\u00a0Thus,\u00a0alter\u00a0it\u00a0from\u00a0true\u00a0to\u00a0false\u00a0if\u00a0it\u00a0was\u00a0true,\u00a0and\u00a0vice\u00a0versa\u00a0if\u00a0it\u00a0was\u00a0false. When&nbsp;I&nbsp;no&nbsp;longer&nbsp;needed&nbsp;to&nbsp;use&nbsp;that&nbsp;screen,&nbsp;I&nbsp;didn&#8217;t&nbsp;want&nbsp;to&nbsp;keep&nbsp;it&nbsp;on&nbsp;the&nbsp;navigator&nbsp;and&nbsp;be&nbsp;able&nbsp;to&nbsp;find&nbsp;it&nbsp;by&nbsp;pressing&nbsp;the&nbsp;back&nbsp;button,&nbsp;so&nbsp;I&nbsp;destroyed&nbsp;the&nbsp;screen.&nbsp;They&nbsp;will&nbsp;only&nbsp;be&nbsp;able&nbsp;to&nbsp;call&nbsp;again&nbsp;through&nbsp;the&nbsp;button&nbsp;to&nbsp;change,&nbsp;and&nbsp;then&nbsp;I&nbsp;destroyed&nbsp;it&nbsp;once&nbsp;more.&nbsp;I&nbsp;made&nbsp;all&nbsp;of&nbsp;that&nbsp;in&nbsp;order&nbsp;to&nbsp;use&nbsp;multi-selection;&nbsp;if&nbsp;it&nbsp;were&nbsp;single&nbsp;selection&nbsp;only,&nbsp;it&nbsp;wouldn&#8217;t&nbsp;be&nbsp;as&nbsp;complicated. I\u00a0also\u00a0work\u00a0on\u00a0the\u00a0docker\u00a0registry,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0to\u00a0complete\u00a0the\u00a0assignment\u00a0that\u00a0Mr.\u00a0Peter\u00a0assigned\u00a0me\u00a0because\u00a0I\u00a0was\u00a0still\u00a0struggling\u00a0with\u00a0the\u00a0SSL.\u00a0I\u00a0also\u00a0generated\u00a0a\u00a0SalesApi\u00a0using\u00a0a\u00a0different\u00a0generator,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0 to\u00a0utilise\u00a0it.\u00a0I\u00a0am\u00a0still\u00a0searching\u00a0for\u00a0examples\u00a0of\u00a0how\u00a0to\u00a0use\u00a0that\u00a0to\u00a0resolve \u00a0the\u00a0problem\u00a0with\u00a0the\u00a0format\u00a0of\u00a0the\u00a0array\u00a0when\u00a0submitting\u00a0the\u00a0warehouses.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Check Box For React Native | Tong Hin&#039;s 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.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check Box For React Native | Tong Hin&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"I had made a new screen the week before. The user must choose the warehouse that he is currently in on the new screen, which appeared right after logging in. So\u00a0I\u00a0created\u00a0a\u00a0checkbox\u00a0for\u00a0react\u00a0native\u00a0paper\u00a0where\u00a0the\u00a0status\u00a0should\u00a0have\u00a0been\u00a0checked\u00a0or\u00a0unchecked\u00a0on\u00a0that\u00a0screen.\u00a0So,\u00a0when\u00a0I\u00a0had\u00a0located\u00a0the\u00a0warehouse&#8217;s\u00a0data,\u00a0I\u00a0mapped\u00a0a\u00a0new\u00a0feature\u00a0to\u00a0it\u00a0called\u00a0isChecked\u00a0with type Boolean and\u00a0set\u00a0it\u00a0to\u00a0false. Next,\u00a0I\u00a0created\u00a0a\u00a0function\u00a0called\u00a0handle\u00a0function\u00a0that\u00a0accepts\u00a0an\u00a0id\u00a0parameter\u00a0and\u00a0has\u00a0a\u00a0condition\u00a0that,\u00a0if\u00a0true,\u00a0changes\u00a0the\u00a0value\u00a0of\u00a0isChecked\u00a0to\u00a0the\u00a0opposite\u00a0value.\u00a0Thus,\u00a0alter\u00a0it\u00a0from\u00a0true\u00a0to\u00a0false\u00a0if\u00a0it\u00a0was\u00a0true,\u00a0and\u00a0vice\u00a0versa\u00a0if\u00a0it\u00a0was\u00a0false. When&nbsp;I&nbsp;no&nbsp;longer&nbsp;needed&nbsp;to&nbsp;use&nbsp;that&nbsp;screen,&nbsp;I&nbsp;didn&#8217;t&nbsp;want&nbsp;to&nbsp;keep&nbsp;it&nbsp;on&nbsp;the&nbsp;navigator&nbsp;and&nbsp;be&nbsp;able&nbsp;to&nbsp;find&nbsp;it&nbsp;by&nbsp;pressing&nbsp;the&nbsp;back&nbsp;button,&nbsp;so&nbsp;I&nbsp;destroyed&nbsp;the&nbsp;screen.&nbsp;They&nbsp;will&nbsp;only&nbsp;be&nbsp;able&nbsp;to&nbsp;call&nbsp;again&nbsp;through&nbsp;the&nbsp;button&nbsp;to&nbsp;change,&nbsp;and&nbsp;then&nbsp;I&nbsp;destroyed&nbsp;it&nbsp;once&nbsp;more.&nbsp;I&nbsp;made&nbsp;all&nbsp;of&nbsp;that&nbsp;in&nbsp;order&nbsp;to&nbsp;use&nbsp;multi-selection;&nbsp;if&nbsp;it&nbsp;were&nbsp;single&nbsp;selection&nbsp;only,&nbsp;it&nbsp;wouldn&#8217;t&nbsp;be&nbsp;as&nbsp;complicated. I\u00a0also\u00a0work\u00a0on\u00a0the\u00a0docker\u00a0registry,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0to\u00a0complete\u00a0the\u00a0assignment\u00a0that\u00a0Mr.\u00a0Peter\u00a0assigned\u00a0me\u00a0because\u00a0I\u00a0was\u00a0still\u00a0struggling\u00a0with\u00a0the\u00a0SSL.\u00a0I\u00a0also\u00a0generated\u00a0a\u00a0SalesApi\u00a0using\u00a0a\u00a0different\u00a0generator,\u00a0but\u00a0I\u00a0was\u00a0unable\u00a0 to\u00a0utilise\u00a0it.\u00a0I\u00a0am\u00a0still\u00a0searching\u00a0for\u00a0examples\u00a0of\u00a0how\u00a0to\u00a0use\u00a0that\u00a0to\u00a0resolve \u00a0the\u00a0problem\u00a0with\u00a0the\u00a0format\u00a0of\u00a0the\u00a0array\u00a0when\u00a0submitting\u00a0the\u00a0warehouses.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\" \/>\n<meta property=\"og:site_name\" content=\"Tong Hin&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-08T07:18:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-08T07:18:27+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\",\"name\":\"TONG HIN MACHINERY\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"sameAs\":[\"https:\/\/www.youtube.com\/channel\/UC60EoxJMNbu8mV0LuEGfrBg\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/wp-content\/uploads\/2020\/10\/web_logo_180_180.jpg\",\"width\":180,\"height\":180,\"caption\":\"TONG HIN MACHINERY\"},\"image\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Tong Hin&#039;s Blog\",\"description\":\"Sharing About Technology\",\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.tonghin.com.my\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#webpage\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\",\"name\":\"Check Box For React Native | Tong Hin&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\"},\"datePublished\":\"2022-08-08T07:18:09+00:00\",\"dateModified\":\"2022-08-08T07:18:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/\",\"name\":\"Check Box For React Native\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/060db6cb6993c7115f5f2edbb7b140b3\"},\"headline\":\"Check Box For React Native\",\"datePublished\":\"2022-08-08T07:18:09+00:00\",\"dateModified\":\"2022-08-08T07:18:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"articleSection\":\"Experiential\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2022\/08\/08\/check-box-react-native\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/060db6cb6993c7115f5f2edbb7b140b3\",\"name\":\"Mohammedi Khalil\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8be22f995cf2350392872dba00c6b019?s=96&d=mm&r=g\",\"caption\":\"Mohammedi Khalil\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/568"}],"collection":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/comments?post=568"}],"version-history":[{"count":3,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":576,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/568\/revisions\/576"}],"wp:attachment":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/media?parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/categories?post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/tags?post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}