CodeWithHarry / NewsMonkey-React

News App created using React and NewsAPI
268 stars 205 forks source link

routing is not working properly . PLEASE HELP!!! #33

Open chitresh-git opened 10 months ago

chitresh-git commented 10 months ago

even after i have used the unique key in the router part , the page is not loaded by itself for example if click on sports tag the page remains unchanged but as soon as i refreshed the whole page , sports news is visible so how can i show sports news without refreshing the site just by clicking on the tag

chitresh-git commented 10 months ago

import logo from './logo.svg'; import React, { Component } from 'react' import './App.css';

import Navbar from './component/Navbar'; import NewsComp from './component/NewsComp';

import { BrowserRouter as Router, Routes, Route, } from "react-router-dom";

export class App extends Component { c = "chitresh" render() { return ( <>

} /> } /> } /> } /> } /> } /> } /> } /> {/* using the local variable */}
  </>
)

} }

export default App

ZeusOnline1998 commented 10 months ago

check your NewsComp componentDidMount whether its properly working or not.

DiwashAdh commented 10 months ago

is it fixed? or need a hand?

Rknilkant commented 8 months ago

routing is not working properly.....

even after i have used the unique key in the router part , the page is not loaded by itself for example if click on sports tag the page remains unchanged but as soon as i refreshed the whole page , sports news is visible so how can i show sports news without refreshing the site just by clicking on the tag

import './App.css';

import React, { Component } from 'react' import NavBar from './components/NavBar'; import News from './components/News'; import { BrowserRouter as Router, Switch, Route, } from "react-router-dom";

export default class App extends Component {

render() { return (

)

} }