Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Removed the warning for `setState` on unmounted components to eliminate false positive warnings, matching upstream React ([#323](https://github.com/Roblox/roact/pull/323)).
* Added Luau analysis to the repository ([#372](https://github.com/Roblox/roact/pull/372))

## [1.4.3](https://github.com/Roblox/roact/releases/tag/v1.4.1) (March 18th, 2022)
* Added types to Roact to better support intellisense.

## [1.4.2](https://github.com/Roblox/roact/releases/tag/v1.4.2) (October 6th, 2021)
* Fixed forwardRef doc code referencing React instead of Roact ([#310](https://github.com/Roblox/roact/pull/310)).
* Fixed `Listeners can only be disconnected once` from context consumers. ([#320](https://github.com/Roblox/roact/pull/320))
Expand Down
20 changes: 16 additions & 4 deletions src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ local RobloxRenderer = require(script.RobloxRenderer)
local strict = require(script.strict)
local Binding = require(script.Binding)

export type ConfigTable = {
elementTracing: boolean?,
internalTypeChecks: boolean?,
propValidation: boolean?,
typeChecks: boolean?,
}

export type SetGlobalConfig = (config: ConfigTable) -> ()

local robloxReconciler = createReconciler(RobloxRenderer)
local reconcilerCompat = createReconcilerCompat(robloxReconciler)

local Roact = strict({
local setGlobalConfig = GlobalConfig.set :: SetGlobalConfig

local Roact = {
Component = require(script.Component),
createElement = require(script.createElement),
createFragment = require(script.createFragment),
Expand All @@ -40,10 +51,11 @@ local Roact = strict({
teardown = reconcilerCompat.teardown,
reconcile = reconcilerCompat.reconcile,

setGlobalConfig = GlobalConfig.set,
setGlobalConfig = setGlobalConfig,

-- APIs that may change in the future without warning
UNSTABLE = {},
})
}

return Roact
export type Roact = typeof(Roact)
return strict(Roact, "Roact") :: Roact