0
When running the npm start command returns the error below in the terminal, I am importing the file /components/footer/Footer.js
in the archive /src/index.js
//ERROR Failed to Compile.
./src/Components/Register/Register.js Attempted import error: 'Footer' is not Exported from '.. /footer/Footer'
//Footer.js
import React from "react";
export default class Footer extends React.Component {
render() {
return (
<footer className="footer">
<div>
<p> Snef Brasil </p>
</div>
</footer>
);
};
}
//index.js
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './components/app/App'
import {Footer} from './components/footer/Footer'
import {Header} from './components/header/Header'
ReactDOM.render(
<App />,
<Footer />,
<Header />,
document.getElementById('root'))
That alone has no answer
– novic
I will edit in more detail
– Marcus Souza
@Virgilionovic just edited, it’s better?
– Marcus Souza
The problem seems to be in Reactdom.render, you have several components, what you would need is to have a div and group all within it, see this answer, it can help you https://stackoverflow.com/questions/41690545/render-multiple-components-by-reactdom
– Bins
Yes you are importing wrong do not need the Keys in this case and also need a root of the master component and call the components inside
– novic