Deloitte Interview Question

How can we update a text dynamically in React JS