Now can you also recreate the same function using React.JS?