Skip to content

Commit 2520195

Browse files
committed
new website and its AMAZING
1 parent 2141b9a commit 2520195

File tree

106 files changed

+6120
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+6120
-330
lines changed

.watchmanconfig

Whitespace-only changes.

packages/react-router-dom/docs/Link.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ import { Link } from 'react-router-dom'
88
<Link to="/about">About</Link>
99
```
1010

11+
## to: string
12+
13+
The pathname or location to link to.
14+
15+
```js
16+
<Link to="/courses"/>
17+
```
18+
1119
## to: object
1220

1321
The location to link to.
@@ -21,18 +29,10 @@ The location to link to.
2129
}}/>
2230
```
2331

24-
## to: string
25-
26-
The pathname or location to link to.
27-
28-
```js
29-
<Link to="/courses"/>
30-
```
31-
3232
## replace: bool
3333

3434
When `true`, clicking the link will replace the current entry in the history stack instead of adding a new one.
3535

3636
```js
37-
<Link replace to="/courses"/>
37+
<Link to="/courses" replace />
3838
```

packages/react-router-dom/docs/NavLink.md

+26-5
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,48 @@ import { NavLink } from 'react-router-dom'
1313
The class to give the element when it is active. There is no default active class. This will be joined with the `className` prop.
1414

1515
```js
16-
<NavLink to="/faq" activeClassName="active">FAQs</NavLink>
16+
<NavLink
17+
to="/faq"
18+
activeClassName="active"
19+
>FAQs</NavLink>
1720
```
1821

1922
## activeStyle: object
2023

2124
The styles to apply to the element when it is active.
2225

2326
```js
24-
<NavLink to="/faq" activeStyle={{ fontWeight: 'bold', color: 'red' }}>FAQs</NavLink>
27+
<NavLink
28+
to="/faq"
29+
activeStyle={{
30+
fontWeight: 'bold',
31+
color: 'red'
32+
}}
33+
>FAQs</NavLink>
2534
```
2635

2736
## exact: bool
2837

2938
When `true`, the active class/style will only be applied if the location is matched exactly.
3039

3140
```js
32-
<NavLink exact to="/profile" activeClassName='active'>Profile</NavLink>
41+
<NavLink
42+
exact
43+
to="/profile"
44+
activeClassName="active"
45+
>Profile</NavLink>
3346
```
3447

3548
## strict: bool
3649

3750
When `true`, the trailing slash on a location's `pathname` will be taken into consideration when determining if the location matches the current URL. See the [`<Route strict>`](../../react-router/docs/Route.md#strict-bool) documentation for more information.
3851

3952
```js
40-
<NavLink strict to="/events/" activeClassName='active'>Events</NavLink>
53+
<NavLink
54+
strict
55+
to="/events/"
56+
activeClassName="active"
57+
>Events</NavLink>
4158
```
4259

4360
## isActive: func
@@ -54,5 +71,9 @@ const oddEvent = (match, location) => {
5471
return !isNaN(eventID) && eventID % 2 === 1
5572
}
5673

57-
<NavLink to="/events/123" isActive={oddEvent} activeClassName="active">Event 123</NavLink>
74+
<NavLink
75+
to="/events/123"
76+
isActive={oddEvent}
77+
activeClassName="active"
78+
>Event 123</NavLink>
5879
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Code Splitting
2+
3+
Code splitting rules!
4+
5+
```js
6+
<Bundle>!</Bundle>
7+
```
8+
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Data Loading
2+
3+
Not gonna lie, not excited about writing this one.
4+
5+
```js
6+
nope()
7+
```
8+
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Quick Start
2+
3+
Gimme 10 minutes, you'll be up and running.
4+
5+
## Create React App
6+
7+
The easiest way to get started with a React web project is with a tool
8+
called Create React App, a Facebook project with a ton of community
9+
help.
10+
11+
## Installation
12+
13+
React Router DOM is published to [npm](https://npm.im/react-router-dom) so you can install it with either `npm` or [`yarn`](https://yarnpkg.com).
14+
15+
```sh
16+
npm install react-router-dom@next
17+
# or
18+
yarn add react-router-dom@next
19+
```
20+
21+
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Scroll Restoration
2+
3+
Browsers are starting to do it! Yay!
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Server Rendering
2+
3+
Yes, I know you still love it.
4+

packages/react-router-native/.watchmanconfig

-1
This file was deleted.

packages/react-router-native/DeepLinking.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import React, { Component, PropTypes } from 'react'
2-
import { Linking, Platform } from 'react-native'
2+
import { Linking } from 'react-native'
33

4-
const regex = Platform.OS === 'android' ? (
5-
/.*?:\/\/.*?\//g
6-
) : (
7-
/.*?:\/\//g
8-
)
4+
const regex = /.*?:\/\//g
95

106
class DeepLinking extends Component {
117
static contextTypes = {
@@ -33,7 +29,7 @@ class DeepLinking extends Component {
3329
}
3430

3531
render() {
36-
return null
32+
return this.props.children
3733
}
3834
}
3935

Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
import React, { Component } from 'react';
2-
import {
3-
StyleSheet,
4-
Text,
5-
View
6-
} from 'react-native'
1+
import React, { Component } from 'react'
2+
import { StyleSheet, Text, View } from 'react-native'
73

8-
import {
9-
NativeRouter,
10-
Route,
11-
Link,
12-
DeepLinking,
13-
Prompt
14-
} from '../main'
4+
import { NativeRouter, Route, Link } from '../main'
155

166
export default class App extends Component {
177
render() {
188
return (
199
<NativeRouter>
2010
<View style={styles.container}>
21-
<DeepLinking/>
2211
<Route exact path="/" render={() => (
2312
<View>
2413
<Text style={styles.welcome}>
@@ -34,7 +23,6 @@ export default class App extends Component {
3423

3524
<Route exact path="/one" render={() => (
3625
<View>
37-
<Prompt message="Are you sure you want to leave this screen?"/>
3826
<Text style={styles.welcome}>
3927
ONE!
4028
</Text>
@@ -47,7 +35,7 @@ export default class App extends Component {
4735
)}/>
4836
</View>
4937
</NativeRouter>
50-
);
38+
)
5139
}
5240
}
5341

@@ -56,17 +44,17 @@ const styles = StyleSheet.create({
5644
flex: 1,
5745
justifyContent: 'center',
5846
alignItems: 'center',
59-
backgroundColor: '#F5FCFF',
47+
backgroundColor: '#F5FCFF'
6048
},
6149
welcome: {
6250
fontSize: 20,
6351
textAlign: 'center',
64-
margin: 10,
52+
margin: 10
6553
},
6654
instructions: {
6755
textAlign: 'center',
6856
color: '#333333',
69-
marginBottom: 5,
70-
},
71-
});
57+
marginBottom: 5
58+
}
59+
})
7260

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Animation
2+
3+
Super important on native.
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Deep Linking
2+
3+
Before you can use `<DeepLinking/>` you need to set it up in your native app configuration.
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Quick Start
2+
3+
Gimme 10 minutes, you'll be up and running.
4+
5+
## Exponent
6+
7+
Easiest way to get started is probably with Exponent.
8+
9+
## Installation
10+
11+
React Router Native is published to [npm](https://npm.im/react-router-native) so you can install it with either `npm` or [`yarn`](https://yarnpkg.com).
12+
13+
```sh
14+
npm install react-router-native@next
15+
# or
16+
yarn add react-router-native@next
17+
```
18+

0 commit comments

Comments
 (0)