This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link | |
} from 'react-router-dom' | |
const BasicExample = () => ( | |
<Router> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link | |
} from 'react-router-dom' | |
const ParamsExample = () => ( | |
<Router> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link, | |
Redirect, | |
withRouter | |
} from 'react-router-dom' | |
//////////////////////////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link | |
} from 'react-router-dom' | |
const CustomLinkExample = () => ( | |
<Router> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link, | |
Prompt | |
} from 'react-router-dom' | |
const PreventingTransitionsExample = () => ( | |
<Router> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link | |
} from 'react-router-dom' | |
const PEEPS = [ | |
{ id: 0, name: 'Michelle', friends: [ 1, 2, 3 ] }, | |
{ id: 1, name: 'Sean', friends: [ 0, 3 ] }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { CSSTransitionGroup } from 'react-transition-group' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link, | |
Redirect | |
} from 'react-router-dom' | |
/* you'll need this CSS somewhere |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = requests.get('https://api.github.com/events', stream=True) | |
print(r.raw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
r = requests.get('https://api.github.com/events') | |
print(r.content) |
OlderNewer