Exercise

Hands-on exercise to test your knowledge of HOCs.

We'll cover the following

Problem

You belong to a team of astronauts that are currently on a mission to discover the secret to life denoted by secretToLife. After many days of research and hard work, your team is finally successful and discovers the secret which turns out to be the number 42. Your team lead has asked you to edit the programming files so that this number can be passed as a prop to other components and be accessible by everyone. Write a higher-order component withSecretToLife in order to achieve this goal.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy