Skip to content

Commit b0bc5af

Browse files
taiontimdorr
authored andcommitted
Remove remaining deprecations
1 parent 3a162a1 commit b0bc5af

File tree

8 files changed

+5
-401
lines changed

8 files changed

+5
-401
lines changed

docs/API.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- [`<IndexLink>`](#indexlink)
77
- [`<RouterContext>`](#routercontext)
88
- [`context.router`](#contextrouter)
9-
- `<RoutingContext>` (deprecated, use `<RouterContext>`)
109

1110
- [Configuration Components](#configuration-components)
1211
- [`<Route>`](#route)
@@ -29,12 +28,6 @@
2928
- [`match()`](#match-routes-location-history-options--cb)
3029
- [`createRoutes()`](#createroutesroutes)
3130
- [`PropTypes`](#proptypes)
32-
- [`useRoutes()`](#useroutescreatehistory-deprecated) (deprecated)
33-
34-
- [Mixins](#mixins-deprecated) (deprecated)
35-
- `Lifecycle` (deprecated)
36-
- `History` (deprecated)
37-
- `RouteContext` (deprecated)
3831

3932

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

119-
##### `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`)**
120-
An object of key:value pairs to be stringified.
121-
122-
##### `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`)**
123-
A hash to put in the URL, e.g. `#a-hash`.
124-
125-
_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._
126-
127-
##### `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`)**
128-
State to persist to the `location`.
112+
_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to the hash.
129113

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

584-
#### `history` (deprecated)
585-
586568
### Named Components
587569
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.
588570

@@ -697,13 +679,3 @@ One or many [`<Route>`](#route)s or [`PlainRoute`](#plainroute)s.
697679
The following prop types are exported at top level and from `react-router/lib/PropTypes`:
698680
- `routerShape`: Shape for the `router` object on context
699681
- `locationShape`: Shape for the `location` object on route component props
700-
701-
Previously, a number of prop types intended for internal use were also exported under `PropTypes`. These are deprecated and should not be used.
702-
703-
704-
### `useRoutes(createHistory)` (deprecated)
705-
706-
707-
## Mixins (deprecated)
708-
709-
Deprecated, please see the [upgrade guide](/upgrade-guides/v2.0.0.md#mixins-are-deprecated).

modules/PropTypes.js

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { PropTypes } from 'react'
22

3-
import deprecateObjectProperties from './deprecateObjectProperties'
4-
import * as InternalPropTypes from './InternalPropTypes'
5-
import warning from './routerWarning'
6-
73
const { func, object, shape, string } = PropTypes
84

95
export const routerShape = shape({
@@ -23,56 +19,3 @@ export const locationShape = shape({
2319
action: string.isRequired,
2420
key: string
2521
})
26-
27-
// Deprecated stuff below:
28-
29-
export let falsy = InternalPropTypes.falsy
30-
export let history = InternalPropTypes.history
31-
export let location = locationShape
32-
export let component = InternalPropTypes.component
33-
export let components = InternalPropTypes.components
34-
export let route = InternalPropTypes.route
35-
export let routes = InternalPropTypes.routes
36-
export let router = routerShape
37-
38-
if (__DEV__) {
39-
const deprecatePropType = (propType, message) => (...args) => {
40-
warning(false, message)
41-
return propType(...args)
42-
}
43-
44-
const deprecateInternalPropType = propType => (
45-
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.')
46-
)
47-
48-
const deprecateRenamedPropType = (propType, name) => (
49-
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.`)
50-
)
51-
52-
falsy = deprecateInternalPropType(falsy)
53-
history = deprecateInternalPropType(history)
54-
component = deprecateInternalPropType(component)
55-
components = deprecateInternalPropType(components)
56-
route = deprecateInternalPropType(route)
57-
routes = deprecateInternalPropType(routes)
58-
59-
location = deprecateRenamedPropType(location, 'location')
60-
router = deprecateRenamedPropType(router, 'router')
61-
}
62-
63-
let defaultExport = {
64-
falsy,
65-
history,
66-
location,
67-
component,
68-
components,
69-
route,
70-
// For some reason, routes was never here.
71-
router
72-
}
73-
74-
if (__DEV__) {
75-
defaultExport = deprecateObjectProperties(defaultExport, 'The default export from `react-router/lib/PropTypes` is deprecated. Please use the named exports instead.')
76-
}
77-
78-
export default defaultExport

modules/RoutingContext.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

modules/__tests__/_bc-serverRendering-test.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)