JSPM

@rbxts-js/react-devtools-core

17.3.7-ts.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 523
  • Score
    100M100P100Q92988F
  • License MIT

Package Exports

  • @rbxts-js/react-devtools-core
  • @rbxts-js/react-devtools-core/src/init.lua

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts-js/react-devtools-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-devtools-core

A React DevTools bridge implementation for React Lua. The implementation of this package deviates heavily from the upstream version.

API

Requiring this package is similar to requiring react-devtools, but provides several configurable options. Unlike react-devtools, requiring react-devtools-core doesn't connect immediately but instead exports a function:

local ReactDevtoolsCore = require(Packages.ReactDevtoolsCore)
local connectToDevtools = ReactDevtoolsCore.connectToDevtools
connectToDevTools(config)

Run connectToDevTools() in the same context as React to set up a connection to DevTools. Be sure to run this function before importing any React package -- e.g. react, react-roblox.

The config object may contain:

  • host: string (defaults to "localhost") - Websocket will connect to this host.
  • port: number (defaults to 8097) - Websocket will connect to this port.
  • useHttps: boolean (defaults to false) - Websocket should use a secure protocol (wss).
  • resolveRNStyle: (style: number) => ?Object - Used by the React Native style plug-in.
  • isAppActive: () => boolean - If provided, DevTools will poll this method and wait until it returns true before connecting to React.