I'm trying to grab the attribute listed in the div being rendered but it returns undefined. Any idea on how to go about it will be greatly appreciated
index.html
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root" data-username="mark"></div>
</body>
index.js
const root = ReactDOM.createRoot(document.getElementById("root"));
if (root) {
console.log(root.dataset)
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
}