Shopify / restyle

A type-enforced system for building UI components in React Native with TypeScript.

Home Page:https://shopify.github.io/restyle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: undefined is not a function (near '...(0, _restyle.createTheme)...')

andrefedev opened this issue · comments

I am trying to implement theme with createTheme but when launching my application in android it throws the following error:

17:48:10.908	client_log	TypeError: undefined is not a function (near '...(0, _restyle.createTheme)...')
17:48:10.909	client_log	Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
17:48:23.920	client_log	TypeError: undefined is not a function (near '...(0, _restyle.createTheme)...')
17:48:23.920	client_log	Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

this launch the error;
const theme = createTheme({// theme options});
this work.
const theme = {//theme};

Try to remove node_modules and re-install everything again, suddenly emulator works but then stop working and throw the same error.

hi @andrefedev how do you resolve this? it happened to me on react-native: "0.70.2" 👀

@sperezm97 If you still need this, it seems "@shopify/restyle": "2.1.0" is broken, it hasn't worked for me in months. Downgrade to 2.0.0 via yarn add @shopify/restyle@2.0.0 and it should work.