@rbxts/react
Advanced tools
+1
-1
| { | ||
| "name": "@rbxts/react", | ||
| "version": "17.3.7-alpha.1", | ||
| "version": "17.3.7-ts.1", | ||
| "description": "React bindings for Roblox", | ||
@@ -5,0 +5,0 @@ "main": "src/init.lua", |
+26
-0
@@ -65,2 +65,28 @@ <p align="center"> | ||
| ### React DevTools | ||
| To connect to DevTools from a new application, you need to import the backend portion of the stack. Add ReactDevtools and ReactGlobals as dependencies in your package manager: | ||
| ```sh | ||
| npm install @rbxts/react-globals@alpha @rbxts/react-devtools-core@alpha | ||
| yarn add @rbxts/react-globals@alpha @rbxts/react-devtools-core@alpha | ||
| pnpm add @rbxts/react-globals@alpha @rbxts/react-devtools-core@alpha # 🔴 See above | ||
| ``` | ||
| Similar to when setting the `__DEV__` or `__PROFILE__` flags, DevTools must be initialized before React is imported. | ||
| ```ts | ||
| import { backend } from "@rbxts/react-devtools-core"; | ||
| import ReactGlobals from "@rbxts/react-globals"; | ||
| // The DEV flag enables some DevTools features you otherwise wouldn't have | ||
| ReactGlobals.__DEV__ = true; | ||
| // The PROFILE flag allows you to run the DevTools profiler | ||
| ReactGlobals.__PROFILE__ = true; | ||
| backend.connectToDevtools(); | ||
| ``` | ||
| Now, if you launch DevTools and then run your code, you should see your React component tree! | ||
| ## 🚀 Examples | ||
@@ -67,0 +93,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
94251
1.06%275
10.44%