Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/3d-dev/react-router-v6

tested the React-router lastest version 6 in codeSandbox
https://github.com/3d-dev/react-router-v6

axios-react browserrouter goback react react-router-dom-v6 react-router-v6 refresh sample-code usenavigate

Last synced: about 2 months ago
JSON representation

tested the React-router lastest version 6 in codeSandbox

Awesome Lists containing this project

README

        

# React-Router-V6 & useNavigate & BrowserRouter & Axios

## Installing
```js
npm install
```

## add the following import statement:
```js
import { BrowserRouter,Route,Routes } from 'react-router-dom';
```

##
```js
} />
} />
```

## implemented the module of geting *json data from url using axios
```js
const fetchData = async () => {
let response = await axios.get(
"https://jsonplaceholder.typicode.com/posts/1/comments"
);
if (response.status === 200) {
setUsers(response.data);
}
};
```