Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [`<IndexLink>`](#indexlink)
- [`<RouterContext>`](#routercontext)
- [`context.router`](#contextrouter)
- `<RoutingContext>` (deprecated, use `<RouterContext>`)

- [Configuration Components](#configuration-components)
- [`<Route>`](#route)
Expand All @@ -29,12 +28,6 @@
- [`match()`](#match-routes-location-history-options--cb)
- [`createRoutes()`](#createroutesroutes)
- [`PropTypes`](#proptypes)
- [`useRoutes()`](#useroutescreatehistory-deprecated) (deprecated)

- [Mixins](#mixins-deprecated) (deprecated)
- `Lifecycle` (deprecated)
- `History` (deprecated)
- `RouteContext` (deprecated)


## Components
Expand Down Expand Up @@ -116,16 +109,7 @@ A [location descriptor](https://github.com/mjackson/history/blob/master/docs/Glo
* `hash`: A hash to put in the URL, e.g. `#a-hash`.
* `state`: State to persist to the `location`.

##### `query` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
An object of key:value pairs to be stringified.

##### `hash` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
A hash to put in the URL, e.g. `#a-hash`.

_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to the hash. Scroll position management utilities are available in the [scroll-behavior](https://github.com/taion/scroll-behavior) library._

##### `state` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
State to persist to the `location`.
_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to the hash.

##### `activeClassName`
The className a `<Link>` receives when its route is active. No active class by default.
Expand Down Expand Up @@ -581,8 +565,6 @@ class App extends React.Component {
}
```

#### `history` (deprecated)

### Named Components
When a route has one or more named components, the child elements are available by name on `this.props`. In this case `this.props.children` will be undefined. All route components can participate in the nesting.

Expand Down Expand Up @@ -697,13 +679,3 @@ One or many [`<Route>`](#route)s or [`PlainRoute`](#plainroute)s.
The following prop types are exported at top level and from `react-router/lib/PropTypes`:
- `routerShape`: Shape for the `router` object on context
- `locationShape`: Shape for the `location` object on route component props

Previously, a number of prop types intended for internal use were also exported under `PropTypes`. These are deprecated and should not be used.


### `useRoutes(createHistory)` (deprecated)


## Mixins (deprecated)

Deprecated, please see the [upgrade guide](/upgrade-guides/v2.0.0.md#mixins-are-deprecated).
57 changes: 0 additions & 57 deletions modules/PropTypes.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { PropTypes } from 'react'

import deprecateObjectProperties from './deprecateObjectProperties'
import * as InternalPropTypes from './InternalPropTypes'
import warning from './routerWarning'

const { func, object, shape, string } = PropTypes

export const routerShape = shape({
Expand All @@ -23,56 +19,3 @@ export const locationShape = shape({
action: string.isRequired,
key: string
})

// Deprecated stuff below:

export let falsy = InternalPropTypes.falsy
export let history = InternalPropTypes.history
export let location = locationShape
export let component = InternalPropTypes.component
export let components = InternalPropTypes.components
export let route = InternalPropTypes.route
export let routes = InternalPropTypes.routes
export let router = routerShape

if (__DEV__) {
const deprecatePropType = (propType, message) => (...args) => {
warning(false, message)
return propType(...args)
}

const deprecateInternalPropType = propType => (
deprecatePropType(propType, 'This prop type is not intended for external use, and was previously exported by mistake. These internal prop types are deprecated for external use, and will be removed in a later version.')
)

const deprecateRenamedPropType = (propType, name) => (
deprecatePropType(propType, `The \`${name}\` prop type is now exported as \`${name}Shape\` to avoid name conflicts. This export is deprecated and will be removed in a later version.`)
)

falsy = deprecateInternalPropType(falsy)
history = deprecateInternalPropType(history)
component = deprecateInternalPropType(component)
components = deprecateInternalPropType(components)
route = deprecateInternalPropType(route)
routes = deprecateInternalPropType(routes)

location = deprecateRenamedPropType(location, 'location')
router = deprecateRenamedPropType(router, 'router')
}

let defaultExport = {
falsy,
history,
location,
component,
components,
route,
// For some reason, routes was never here.
router
}

if (__DEV__) {
defaultExport = deprecateObjectProperties(defaultExport, 'The default export from `react-router/lib/PropTypes` is deprecated. Please use the named exports instead.')
}

export default defaultExport
15 changes: 0 additions & 15 deletions modules/RoutingContext.js

This file was deleted.

104 changes: 0 additions & 104 deletions modules/__tests__/_bc-serverRendering-test.js

This file was deleted.

Loading