Pregunta de entrevista de Embross

How would you solve this React issue