How to get props on recompose lifecycle without using `this`?

Viewed 942

I'm using eslint-plugin-immutable so I can't use this keyword (I can eslint-disable-line, but I don't want to), so I'm wondering if there is any way with recompose to access the props inside any of the mount lifecycle, without using the this keyword.

const enhance = compose(
  lifecycle({
    componentWillMount() {
      const { props } = this // throws eslint error
      console.log(this.props); // works, throws eslint error
    },
  }),
);
2 Answers
Related