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

Updating keyed/react-tracked failed #1797

Closed
krausest opened this issue Dec 14, 2024 · 2 comments
Closed

Updating keyed/react-tracked failed #1797

krausest opened this issue Dec 14, 2024 · 2 comments

Comments

@krausest
Copy link
Owner

As in #1789 I'm updating all implementations. Implementations that failed to update are moved in to the broken-frameworks folder.
Here's what I'm trying to update:

 react-tracked          1.7.11  →   2.0.1
 terser-webpack-plugin  5.3.10  →  5.3.11

The build fails with the following runtime error:

main.js:2 Uncaught TypeError: (0 , r.memo) is not a function
    at main.js:2:187896
    at main.js:2:189981

@dai-shi Can you take a look at this?

@dai-shi
Copy link
Contributor

dai-shi commented Dec 14, 2024

Hi, thanks for taking care of it.

Just taking a quick look: Since v2, react-tracked dropped custom memo as now it's compatible with React.memo. So, we can use it instead.

import React, { useReducer } from "react";
import { createRoot } from 'react-dom/client';
import { createContainer, memo } from "react-tracked";

- import React, { useReducer } from "react";
+ import React, { useReducer, memo } from "react";
  import { createRoot } from 'react-dom/client';
- import { createContainer, memo } from "react-tracked";
+ import { createContainer } from "react-tracked";

Let me know if that doesn't work. I need to deep dive then.

@krausest
Copy link
Owner Author

Thanks - that worked.

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

No branches or pull requests

2 participants