This short article shows code examples how hooks are analogous to components in terms of composition. Without a word, let's jump in the code. React components Let's use a minimalistic example. Here's a component. Well, this component is a little bit big, so let's split it into functions and compose them.