DEV Community

Basil
Basil

Posted on

react export and import components

You can rename your default export component when importing.
example:
**

exporting in the App.js component**

function App(){
return(

put content here

);
}
export default App

importing in index.js component

import React from 'react'
import ReactDom from 'react-dom'
import MyApp from './App'

ReactDOM.render(,document.getElementById("root")

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay