0

I am trying to add footer.js in my react App.js

This is my app.js.

import React, { Component } from "react";
import "./App.css";

import Navbar from "./Navbar";
class App extends Component {
  render() {
    return (
      <div className="App">
        <BrowserRouter>
          <div>
            <Navbar />    
            <Switch>
              <Route path="/" exact component={Home} />
              <Route path="/SignIn" component={SignIn} />
            </Switch>
            <navfooter />
          </div>
        </BrowserRouter>
      </div>
    );
  }
}

export default App;

In my App.js file, I have used NavBar and it is working fine. I am using the same concept to add footer.js file in App.js file. I could also try using a pre-built footer file, but I wanted my own footer file. this is my footer.js

import React from "react";

const navfooter = (props) => {
  return (
    <div>
      <p>footer</p>
    </div>        
  );
};

export default navfooter;

And it shows like this:

enter image description here

My code editor, VS Code is not showing any errors or warnings. But the console shows an error:

enter image description here

SO what am I doing wrong?

1
  • 1
    rename to NavFooter, component should start with a capital letter Commented Dec 31, 2020 at 16:28

1 Answer 1

2

Sorry, I just realized my mistake, instead of navfooter, I should have written Navfooter

Sign up to request clarification or add additional context in comments.

1 Comment

You also need to import it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.