Skip to content

Invalid hook call. Cannot read property 'useContext' of null #847

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

Closed
1 of 2 tasks
Malberee opened this issue May 20, 2025 · 1 comment
Closed
1 of 2 tasks

Invalid hook call. Cannot read property 'useContext' of null #847

Malberee opened this issue May 20, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Malberee
Copy link

Malberee commented May 20, 2025

Description

Hello. In the initial configuration I only changed the contents of index.tsx, making it a simple component and didn't change anything else

// src/index.tsx

import { View } from 'react-native';

export const Button = () => {
  return (
    <View style={{{ width: 100, height: 100, backgroundColor: 'red' }}></View>}
  );
};

Error:
Image

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

JavaScript library

Link to repro

.

Environment

System:
OS: Windows 11 10.0.22621
CPU: (6) x64 Intel(R) Core(TM) i5-9600KF CPU @ 3.70GHz
Memory: 2.87 GB / 15.94 GB
Binaries:
Node:
version: 23.11.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 3.6.1
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 9.6.3
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "33"
- "34"
- "35"
Build Tools:
- 34.0.0
System Images:
- android-34 | Google APIs Intel x86 Atom_64
- android-34 | Google Play Intel x86 Atom_64
- android-TiramisuPrivacySandbox | Google Play Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.11090377
Visual Studio: Not Found
Languages:
Java:
version: 18.0.2.1
path: /c/Program Files/Common Files/Oracle/Java/javapath/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 18.0.0
wanted: latest
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.79.2
wanted: 0.79.2
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

@Malberee Malberee added the bug Something isn't working label May 20, 2025
@Malberee
Copy link
Author

#849 helped. @jkrmarmol thank you so much! I've been looking for a solution for 3 days. Hope the pull request will be accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant