i'm messing with React and i was trying to make some transition between the router pages. Before using the switch tag, my code was working just fine, but after, the roter wont work and no components get rendered.
This is my app.js
import React, { Component } from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import "./App.scss";
import "./vendor/bootstrap/bootstrap-reboot.min.css";
import "./vendor/bootstrap/bootstrap-grid.css";
import Content from "./components/Content";
import Header from "./components/Header";
import Skills from "./components/Skills";
import Portfolio from "./components/Portfolio";
import Timeline from "./components/Timeline";
import Footer from "./components/Footer";
import Monitoria from "./components/Monitoria";
import About from "./components/About";
import Contact from "./components/Contact";
class App extends Component {
state = {
header_infos: [
{
job: "Desenvolvedor Web",
college: "Faculdade Guararapes - Ciência da Computação 5º Período"
}
]
};
render() {
return (
);
}
}
export default App;
If needed, this is my navbar class:
import React from "react";
import "../sass/Header.scss";
import { NavLink } from "react-router-dom";
const Header = () => {
return (
);
};
export default Header;
Actually, i dont know if i was doing the router the right way before, because i was using 3 . The reason was that i needed only these 3 components to be loaded in my index, and this was my workaround.
Before the modification, i was using only BrowserRouter and Route, no switch and it worked just fine, but without the transition animations. So i tried to follow one tutorial, and it said that i needed to use Switch and now nothing gets rendered and i really dont know why. Thanks, as always.
This is the tutorial i followed:
https://www.youtube.com/watch?v=NUQkajBdnmQ
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)