0

In React-strap, components have the name 'Example' by default. Can someone explain to me why I get the below duplicate error,

Module build failed: D:/workspace/html5/rnd/react/scotch-io-routing-react/src/bsp/nav.component.jsx: Duplicate declaration "Nav"

If I do this to the Navbar component:

//in bsp/nav.component.jsx
export default class Nav extends React.Component {
  constructor(props) {
    super(props);

    this.toggle = this.toggle.bind(this);
    this.state = {
      isOpen: false
    };
  }
  ...

Changing it back to Example and things are fine. I am trying to understand what I am doing wrong here, is it inheritance related?

I owe you a cup of coffe!

1 Answers1

0

I doubt there's anything special about the component name Example.

I think you'll find changing the name of your component to something like MyNav will also work.

Most likely the ReactStrap component Nav is the reason for the error.

grantnz
  • 7,322
  • 1
  • 31
  • 38