Converting a Preact Component to use hooks with Sophia Li

— 2 minute read

Boost on DEV

A few weeks ago, I wrote a post asking DEV community members if they wanted to potentially pair program with me during a live coding session.

A lot of interest was generated and so we did our first live coding pairing session that was streamed on It was with DEV community member Sophia Li.

She worked on the <ImageUploader /> Preact component in the DEV/forem codebase. It was originally a class component that she converted to a function component using the [useState]( usestate) hook.

For the full recording of the pairing session check out the YouTube video below. Also, feel free to subscribe to my channel. 😉

Near the end of the pairing session we discussed the possibility of using the [useReducer]( usereducer) hook instead. After the pairing session, Sophia continued working on the PR she created and implemented the necessary changes to use the useReducer hook.

For those interested, here is the merged PR.

It was awesome pairing with Sophia and by the way, she’s looking for her next role!

Looking forward to the next pairing session!

Update August 6th, 2020: Check out Sophia’s post!

Comment on DEV