JSPM

@rbxts/react-internal

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35
  • Score
    100M100P100Q10234F
  • License MIT

Package Exports

  • @rbxts/react-internal
  • @rbxts/react-internal/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/react-internal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react

React is a library for creating user interfaces.

The react package contains only the functionality necessary to define React components. It is typically used together with a React renderer like react-roblox.

Usage

local React = require(Path.To.React)
local ReactRoblox = require(Path.To.ReactRoblox)

local e = React.createElement
local useState = React.useState

local function Counter()
    local count, setCount = useState(0)

    return e("Frame", {}, {
        CurrentCount = e("TextLabel", {
            Text = count,
            ...
        }),
        IncrementButton = e("TextButton", {
            Text = "Increment",
            ...,

            [React.Event.Activated] = function()
                setCount(count + 1)
            end
        })
    })
end

local root = ReactRoblox.createRoot(Instance.new("Folder"))
root:render(ReactRoblox.createPortal(e(Counter), playerGui))

Documentation

See https://react.dev/

API

See https://react.dev/reference/react