search/
Start typing to search packages!
package_2
roact
By @firere
Roblox
MirroredRoact
An extension of [Roblox's Roact](https://github.com/Roblox/roact)
Installation
Method 1: Filesystem
- Copy the
srcdirectory into your codebase - Rename the folder to
Roact - Use a plugin like Rojo to sync the files into a place
Method 2: Wally
- Add Wally to your project
- Add
firere/roactto yourdependenciesinwally.toml
What's the difference?
- Whenever a prop is passed into a host component which is not a valid property of the target Roblox class, it does not error and simply skips over trying to apply it
- Whenever children are passed in both the
Roact.Childrenkey ofpropsand in thechildrenarguments ofcreateElement, it will automatically merge them both- If 2 keys with the same name are found in both arguments, the
childrenargument will replace the one inprops; this can be configured
- If 2 keys with the same name are found in both arguments, the
Documentation
For a detailed guide and examples, check out the documentation.
local LocalPlayer = game:GetService("Players").LocalPlayer
local Roact = require(Roact)
-- Create our virtual tree describing a full-screen text label.
local tree = Roact.createElement("ScreenGui", {
[Roact.Children] = {
Image = Roact.createElement("ImageLabel", {
InvalidProp = "InvalidProp is not a valid property on the ImageLabel class" -- This does not produce an error.
})
}
}, {
Label = Roact.createElement("TextLabel", { -- Both Image and Label will be children of tree.
Text = "Hello, world!",
Size = UDim2.new(1, 0, 1, 0),
}),
})
-- Turn our virtual tree into real instances and put them in PlayerGui
Roact.mount(tree, LocalPlayer.PlayerGui, "HelloWorld")
License
Roact is available under the Apache 2.0 license. See LICENSE.txt for details.
Package Details
Install command (Click to copy)
Version
1.5.0
License
Apache-2.0
Safe for commercial use
Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved.
Automated license review — not legal advice.
