Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'oneOf' of undefined #26

Open
ltsharma opened this issue May 16, 2018 · 1 comment
Open

TypeError: Cannot read property 'oneOf' of undefined #26

ltsharma opened this issue May 16, 2018 · 1 comment

Comments

@ltsharma
Copy link

ltsharma commented May 16, 2018

Using
import { Push } from "react-history/Actions";

Error
TypeError: Cannot read property 'oneOf' of undefined

8 | var action = exports.action = _react.PropTypes.oneOf(['PUSH', 'REPLACE', 'POP']);

@gitgrimbo
Copy link

gitgrimbo commented Aug 13, 2018

Related to incompatibility with React 16 I believe. See #30.

I'm currently trying this as a workaround.

import "./react-history-compat";
import History from "react-history/BrowserHistory";

where "./react-history-compat" is

import React from "react";
import PropTypes from "prop-types";
React.PropTypes = PropTypes;

Or use the version published by @researchgate at https://github.com/researchgate/react-history/releases/tag/v0.19.1.

npm i --save @researchgate/react-history

import { BrowserHistory as History } from "@researchgate/react-history"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants