Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$namespace is deprecated in /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 41
Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$rest_base is deprecated in /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 42
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /home2/rainyuxu/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home2/rainyuxu/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":408,"date":"2022-06-03T02:09:45","date_gmt":"2022-06-03T06:09:45","guid":{"rendered":"https:\/\/rainyuxuan.com\/?p=408"},"modified":"2023-12-21T23:17:20","modified_gmt":"2023-12-22T04:17:20","slug":"react-cheatsheet-hooks","status":"publish","type":"post","link":"https:\/\/rainyuxuan.com\/posts\/react-cheatsheet-hooks\/","title":{"rendered":"React Cheatsheet | Hooks"},"content":{"rendered":"\n
useState<\/code><\/h2>\n\n\n\n
A state is a private property of a component and is fully controlled by the component. When the value of a state changes, the component will be re-rendered.<\/p>\n\n\n\n
State value must be changed by the setState<\/code> function to trigger re-render. <\/p>\n\n\n\n
Generally, if setState<\/code> does not assign a new value, then re-render may not be triggered.<\/p>\n\n\n\n