react native reanimated error r.g.__reanimatedWorkletInit is not a function.

Please provide the following:

  1. SDK Version:
  2. Platforms(Android/iOS/web/all):

Did you know: You can turn off automatic updates under Devices in the footer?

r.g.__reanimatedWorkletInit is not a function
TypeError: r.g.__reanimatedWorkletInit is not a function
at t.Z (@react-navigation/drawer.js:3:92572)
at co ([snack internals]
at nl ([snack internals]
at Zl ([snack internals]
at Xl ([snack internals]
at Kl ([snack internals]
at Ll ([snack internals]
at _a ([snack internals]
at Yl ([snack internals]
at Be (https://snack-web-player.s3.us-west-1.amazonaws.com/v2/46/static/js/2.

How to handle that problem

Hi @fitrapradana,

You’ll have to add a polyfill as a workaround on Snack for this. Please detailed information and link to the working snack in this post: Expo Snack a.g.__reanimatedWorkletInit is not a function. - #2 by amanhimself

1 Like

after I click login the problem appears, where I have to add it so that this problem can be completed

I’m not sure what do you mean by login. Also, the snack you shared, doesn’t seem to have the file polyfill.ts with the following code (also shared in the example I linked earlier):

// temporary workaround for expo 45 bug:
// https://github.com/expo/snack/pull/292
// fix: https://github.com/wcandillon/react-native-redash/issues/395#issuecomment-839586492
global.__reanimatedWorkletInit = function () {}
//https://github.com/expo/expo/issues/17758

export default {}

You’ll have to create it for react-native-reanimated library to work on Snack.

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