I have a problem that I don\'t know how to solve, I get this error when running npm test
Invariant Violation: You should not use
Always put BrowserRouter in the navegations components, follow the example:
import React, { Component } from 'react'
import { render } from 'react-dom'
import { BrowserRouter, Route, NavLink, Switch } from 'react-router-dom'
var Componente1 = () => (Componente 1)
var Componente2 = () => (Componente 2)
var Componente3 = () => (Componente 3)
class Rotas extends Component {
render() {
return (
)
}
}
class Navegacao extends Component {
render() {
return (
-
Comp1
-
Comp2
-
Comp3
)
}
}
class App extends Component {
render() {
return (
)
}
}
render( , document.getElementById("root"))
Note: the BrowserRouter accept only one children element.