Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

[0.25.0 update] createEagerFactory production only error #489

@dlebedynskyi

Description

@dlebedynskyi

after update to 0.25.0 start getting

Error walking your react tree
TypeError: Class constructor OnMount cannot be invoked without 'new'
at createEagerElementUtil (/app/node_modules/recompose/utils/createEagerElementUtil.js:18:12)
at /app/node_modules/recompose/createEagerFactory.js:18:49
at ShouldUpdate.render (/app/node_modules/recompose/shouldUpdate.js:45:16)
at /app/node_modules/react-tree-walker/commonjs/index.js:148:35
at doTraverse (/app/node_modules/react-tree-walker/commonjs/index.js:78:21)

was all fine on 0.24.0

OnMount component is pretty plain

export default (timeout = 0) => BaseComponent =>
  class OnMount extends PureComponent {
    state = { isMounted: false };

    componentDidMount() {
      this.mounted = true;
      setTimeout(() => {
        if (this.mounted) {
          this.setState({ isMounted: true });
        }
      }, timeout);
    }

    componentWillUnmount() {
      this.mounted = false;
    }

    mouted = false;

    render = () =>
      <BaseComponent isMounted={this.state.isMounted} {...this.props} />;
  };

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions