Converting a Preact Component to use hooks with Sophia Li

1 minute read

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 doingdevfordev.com. 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 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 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.

The https://github.com/forem/forem/pull/9369 repository on GitHubOpenGraph image for https://github.com/forem/forem/pull/9369

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

Looking forward to the next pairing session!