Testing latest React API: React Hook by superoo7

View this thread on steempeak.com
· @superoo7 ·
$2.05
Testing latest React API: React Hook
# Testing out React (v16.8.0-alpha) Latest API

![Screenshot 2019-01-12 at 1.02.27 AM.png](https://cdn.steemitimages.com/DQmdKfwpi2em9wSWudJzt8qLYTtJMLjCiyvuKna75F7JH4Y/Screenshot%202019-01-12%20at%201.02.27%20AM.png)

## React Hooks

> Take note that React Hooks are still in Alpha.

[Sample code](https://github.com/superoo7/react-16.8.0-alpha/blob/master/src/main/Hooks.tsx)

React Hooks are available for functional component which are a "replacement" for react state in class component.

Using `useState()` you can create an array, where the first item in the array is the state, and the second item is a function to set the state.

[Read more about React useState()](https://reactjs.org/docs/hooks-state.html)

What makes hook really awesome is `useEffect()` function, because it replace 3 lifecycle hooks of react class component (`componentDidMount`, `componentWillUnmount()` & `componentDidUpdate`)

[Read more about React useEffect()](https://reactjs.org/docs/hooks-effect.html)


Ultimately, with React Hooks, you are able to write even less codes and in a more functional approach.

# Live version

Live version of the site is at https://superoo7.github.io/react-16.8.0-alpha/

The source code is on [GitHub](https://github.com/superoo7/react-16.8.0-alpha), which includes another few latest API (React.Suspense, Context API and Hooks)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 504 others
properties (23)
post_id68,688,842
authorsuperoo7
permlinktesting-latest-react-api-react-hook
categoryreact
json_metadata{"tags":["react","web","opensource","javascript","teammalaysia"],"image":["https:\/\/cdn.steemitimages.com\/DQmdKfwpi2em9wSWudJzt8qLYTtJMLjCiyvuKna75F7JH4Y\/Screenshot%202019-01-12%20at%201.02.27%20AM.png"],"links":["https:\/\/github.com\/superoo7\/react-16.8.0-alpha\/blob\/master\/src\/main\/Hooks.tsx","https:\/\/reactjs.org\/docs\/hooks-state.html","https:\/\/reactjs.org\/docs\/hooks-effect.html","https:\/\/superoo7.github.io\/react-16.8.0-alpha\/","https:\/\/github.com\/superoo7\/react-16.8.0-alpha"],"app":"steemit\/0.1","format":"markdown"}
created2019-01-11 17:10:33
last_update2019-01-11 17:10:33
depth0
children4
net_rshares4,101,267,336,571
last_payout2019-01-18 17:10:33
cashout_time1969-12-31 23:59:59
total_payout_value1.596 SBD
curator_payout_value0.456 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,347
author_reputation25,572,770,303,018
root_title"Testing latest React API: React Hook"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (568)
@teammalaysia ·
#### You’ve been upvoted by **TeamMalaysia** Community :- 
To support the growth of TeamMalaysia Follow our upvotes by using **steemauto.com** and follow trail of @myach

Vote **TeamMalaysia** witness bitrocker2020 using this link <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=bitrocker2020&approve=true">vote for witness</a>
👍  
properties (23)
post_id68,689,480
authorteammalaysia
permlinkbbbxqggbbc
categoryreact
json_metadata{"tags":["teammalaysiadevtest","teammalaysia"],"app":"stephard\/0.1"}
created2019-01-11 17:27:06
last_update2019-01-11 17:27:06
depth1
children0
net_rshares566,275,974
last_payout2019-01-18 17:27:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length351
author_reputation198,507,892,119
root_title"Testing latest React API: React Hook"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@steem-plus ·
SteemPlus upvote
Hi, @superoo7!

You just got a **0.9%** upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in [here](https://steemit.com/@steem-plus) to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
properties (22)
post_id68,713,758
authorsteem-plus
permlinktesting-latest-react-api-react-hook---vote-steemplus
categoryreact
json_metadata{}
created2019-01-12 08:46:06
last_update2019-01-12 08:46:06
depth1
children0
net_rshares0
last_payout2019-01-19 08:46:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length434
author_reputation247,995,867,762,997
root_title"Testing latest React API: React Hook"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@surpassinggoogle ·
Task Request. We Modified Our Task Request To Add Core Features & 'Communities' To Ulogs.org, Simplifying The 1.5 Task Drastically. + (500 Steem Is Completed In 7 days/550 Steem For 5 Days)


The task has been drastically simplified and the first task is partially done. Ulogs is front-end only and a fork of busy. It uses React JS. This tasks have been delayed. It has been more than a month already. Please consider helping me or please pass it on, to anyone who can help me. The time allotment for both tasks is 7 days.


https://steemit.com/utopian-io/@surpassinggoogle/task-request-we-modified-our-task-request-to-add-core-features-and-communities-to-ulogs-org-simplifying-the-1-5-task-drastically
properties (22)
post_id68,846,307
authorsurpassinggoogle
permlinkre-superoo7-testing-latest-react-api-react-hook-20190115t160221464z
categoryreact
json_metadata{"tags":["react"],"links":["https:\/\/steemit.com\/utopian-io\/@surpassinggoogle\/task-request-we-modified-our-task-request-to-add-core-features-and-communities-to-ulogs-org-simplifying-the-1-5-task-drastically"],"app":"steemit\/0.1"}
created2019-01-15 16:02:27
last_update2019-01-15 16:02:27
depth1
children0
net_rshares0
last_payout2019-01-22 16:02:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length702
author_reputation508,940,095,151,809
root_title"Testing latest React API: React Hook"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemitboard ·
Congratulations @superoo7! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@superoo7/votes.png?201901221109</td><td>You made more than 13000 upvotes. Your next target is to reach 14000 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board](https://steemitboard.com/@superoo7)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
post_id69,155,620
authorsteemitboard
permlinksteemitboard-notify-superoo7-20190122t115302000z
categoryreact
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2019-01-22 11:53:03
last_update2019-01-22 11:53:03
depth1
children0
net_rshares0
last_payout2019-01-29 11:53:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length749
author_reputation38,705,954,145,809
root_title"Testing latest React API: React Hook"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000