Try this:
import React from "react";
import ReactDOM from "react-dom";
import uuid from "uuid";
function App() {
return (
<div className="App">
<h1>{uuid.v4()}</h1>
</div>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
This is a working example: https://codesandbox.io/s/0pr5vz48kv