Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@rbxts/react

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rbxts/react - npm Package Compare versions

Comparing version
17.3.7-alpha.1
to
17.3.7-ts.1
+1
-1
package.json
{
"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",

@@ -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 @@