Help on React Portfolio

Hi,

This is my first attempt at creating my portfolio using REACT. Things were going well until I tried to create a navbar component.

Can someone please have a look at my code and help me to understand why i keep receiving this error: ReactDOM.render is no longer supported in React 18
and why everything disappears in the localhost:3000 view.

Thank you.

Maryan

Hi Maryan,
You are using React 18, which was recently released. They have changed the root render method.

Follow the instructions listed here to make necessary changes:

Alternatively, you can use a react and react-dom version less than 18, and your code should work fine.

Cheers,
Prabs

1 Like

If you take a look at the initial build of a create-react-app, you can see the new createRoot being used in index.js. It’s pretty straightforward! Your index.html in the public folder has a div in the body with id ‘root’ that you can then render to.

1 Like