Deloitte interview question

How can we update a text dynamically in React JS