_react["default"].memo is not a function.

#1

Hello, I was porting my react native vanilla project to expo while this error appeared:

_react[“default”].memo is not a function. (In ‘_react[“default”].memo(ConnectFunction)’, ‘_react[“default”].memo’ is undefined)

wrapWithConnect
connectAdvanced.js:339:48

ToDo.js:223:60
loadModuleImplementation
require.js:292:12

DiaryPage.js:6
loadModuleImplementation
require.js:292:12

Diary.js:7
loadModuleImplementation
require.js:292:12

Main.js:1
loadModuleImplementation
require.js:292:12

App.js:4
loadModuleImplementation
require.js:292:12

AppEntry.js:2
loadModuleImplementation
require.js:292:12
guardedLoadModule
require.js:179:45
global code
:0

Thank you in advance

#2

Hey @emanuele,

You need to use the appropriate fork of RN for whatever SDK version your Expo project is running. Hooks are not available in Expo yet. You can find said fork here: https://docs.expo.io/versions/v32.0.0/workflow/upgrading-expo-sdk-walkthrough/

Cheers,
Adam

#3

Thanks @adamjnav, these are my npm packages:

“expo”: “^32.0.0”,
“jwt-decode”: “^2.2.0”,
“react”: “16.5.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz”,
“react-native-calendars”: “^1.32.0”,
“react-native-modalbox”: “^1.7.1”,
“react-navigation”: “^3.6.0”,
“react-redux”: “^6.0.1”,
“redux”: “^4.0.1”

What should I do?

#4

I have exactly the same settings in package.json… and same error occurred.

#5

Do any of your other dependencies rely or expect RN 0.59/Hooks compatibility?

#6

I think it happens because of Hooks. From v.7.0.1 react-redux

connect now uses React.memo() internally, which returns a special
object rather than a function.

And it’s rewritten with Hooks. Downgrading react-redux to v.6.0.0 helps.
Got that solution from here https://stackoverflow.com/a/55693526/4588517

#7

@jkhusanov exactly, you’re right, downgrading react-redux to v.6.0.1 solved this problem.

1 Like
#8

Glad we got to the bottom of it! Thanks for sharing the answer with us @jkhusanov!

#9

I’m just learning react. Until this problem gets solved: What are the correct (recommended) steps to take in order to downgrade react-redux to v.6.0.1?. I allready uninstalled and intalled v6.0.1 but that did not worked.

closed #10

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.