This package has been deprecated

Author message:

This is not longer needed since Expo SDK v33 now supports hooks: https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c 🤷🏻‍♂️

@kevinwolf/expo-enable-hooks

1.0.1 • Public • Published

version downloads MIT License

🎣 @kevinwolf/expo-enable-hooks

Easily enable hooks on an Expo project.

The problem

Expo does not support React Native >= 0.59.0 yet (the one with hooks enabled), so if you want to useState, useEffect or any hook, you will receive an error.

This solution

This package patches the node_modules/react-native/Libraries/Renderer folder, adding support for hooks following this workflow.

Installation

This package is distributed via NPM. Install it as a development dependency on your project.

yarn add -D @kevinwolf/expo-enable-hooks

IMPORTANT: Make sure you have installed react@>=16.8.0 to use React Hooks.

Usage

Just add the binary of this package as a postinstall hook on your package.json

{
  "scripts": {
    "postinstall": "expo-enable-hooks"
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @kevinwolf/expo-enable-hooks

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

2.26 MB

Total Files

18

Last publish

Collaborators

  • kevinwolf