Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

export types #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module.exports = {
"react/jsx-no-comment-textnodes": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-space-before-closing": 1,
"react/jsx-tag-spacing": 1,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/jsx-wrap-multilines": 1,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"react-test-renderer": "^15.6.1"
},
"peerDependencies": {
"react": "15.6.1",
"react-dom": "15.6.1"
"react": ">=17.0.2",
"react-dom": ">=17.0.2"
}
}
3 changes: 2 additions & 1 deletion src/components/Redirect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Redirect extends React.Component {
replace: false
};

componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
const {serverResult} = this.context.router;

if (serverResult) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/RouteContext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class RouteContext extends React.PureComponent {
listen: this._listeners.listen
};

componentWillReceiveProps(nextProps: RouteContextProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps: RouteContextProps) {
if (nextProps.match !== this.props.match || nextProps.location !== this.props.location) {
this.routerContext.match = nextProps.match;
this.routerContext.location = nextProps.location;
Expand Down
4 changes: 2 additions & 2 deletions src/components/RouteRenderer/__tests__/testRouteRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('<RouteRenderer>', () => {
it('should call onNavigate upon render', () => {
const onNavigate = jest.fn();
const location = {pathname: '/'};
const wrapper = mount(
mount(
<RouteRenderer
location={location}
routes={[
Expand All @@ -148,6 +148,6 @@ describe('<RouteRenderer>', () => {
/>,
{context}
);
expect(onNavigate).toHaveBeenCalledWith({location, match: {urlName: 'home', params: {}}})
expect(onNavigate).toHaveBeenCalledWith({location, match: {urlName: 'home', params: {}}});
});
});
20 changes: 20 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ export {
withRouter,
createServerHistory
};

export type {
ServerResult,
State,
Location,
History,
UrlConf,
Params,
Query,
Match,
LinkProps,
LinkCallbackProps,
Navigate,
LinkMiddleware,
OnNavigateCallback,
OnClickCallback,
OnVisibilityCallback,
RefProps,
RouterProps
} from './types';
Loading