mridgway / hoist-non-react-statics

Copies non-react specific statics from a child component to a parent component
Other
1.8k stars 93 forks source link

Use the latest react-is feature "isMemo" but without upgrading to the correct version of react-is #78

Closed KevinYaoooooo closed 4 years ago

KevinYaoooooo commented 5 years ago

Use the latest react-is feature "isMemo" but without upgrading to the correct version of react-is

WHY?

eps1lon commented 5 years ago

Use the latest react-is feature "isMemo" but without upgrading to the correct version of react-is

WHY?

We're not: https://github.com/mridgway/hoist-non-react-statics/blob/4fbd062b55ccb657b631505728bc043000ece9a5/package.json#L27

Do you get the same error as #74?

KevinYaoooooo commented 5 years ago

Use the latest react-is feature "isMemo" but without upgrading to the correct version of react-is WHY?

We're not:

hoist-non-react-statics/package.json

Line 27 in 4fbd062

"react-is": "^16.7.0" Do you get the same error as #74?

Yes, exactly the same error. any solution on this?

KevinYaoooooo commented 5 years ago

WHY do you use the "higher" feature without upgrading the dependencies, it would caused a lot of error who using this lib.

eps1lon commented 5 years ago

WHY do you use the "higher" feature without upgrading the dependencies, it would caused a lot of error who using this lib.

I already told you we upgraded the dependency: https://github.com/mridgway/hoist-non-react-statics/pull/73/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L27

The package manager you're using seems to create a broken node_modules/ layout. Maybe your build pipeline is responsible for it.

KevinYaoooooo commented 5 years ago

WHY do you use the "higher" feature without upgrading the dependencies, it would caused a lot of error who using this lib.

I already told you we upgraded the dependency: https://github.com/mridgway/hoist-non-react-statics/pull/73/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L27

The package manager you're using seems to create a broken node_modules/ layout. Maybe your build pipeline is responsible for it.

No~~ 16.7.0 does not have the isMemo function either, it's on 16.8.1

see here: https://github.com/CompuIves/codesandbox-client/issues/1521#issuecomment-461975018

KevinYaoooooo commented 5 years ago

quote here:

So this means that the requested version by hoist-non-react-statics is ^16.6.3, and the resolved version is 16.7.0, which is correct. isMemo got added in 16.8.1.

KevinYaoooooo commented 5 years ago

Sorry, my bad, my misunderstanding.

manelet commented 5 years ago

Using hoist-non-react-statics with NextJS is also causing this problem for me

TypeError: ReactIs.isMemo is not a function

Which is the fix? If isMemo is added in 16.7.0 shouldn't it be working?

Thanks for your time in advance.

eps1lon commented 5 years ago

This is likely an issue with the build setup from NextJS. next requires react-is@16.6.3 which does not include isMemo. It would be solved automatically if next wouldn't pint their dependencies to PATCH but rather MAJOR but they insist on it.

DBeardionaire commented 5 years ago

I'm also getting this error from react-redux connect() method after installing on new machine, right now I'm just checking if

If (isMemo && If isMemo(component))

in the .cjs file locally to get around it for now... any reason not to put the "react-is" dep to "16.8.1"?

eps1lon commented 5 years ago

@DBeardionaire your build setup is probably broken. Try resolutions field in your package.json to force a single version.

Why we dont bump the version? We dont need to as is shown in the conversation here.