mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
feat: add peek and roblox-ts types
This commit is contained in:
parent
d2979ebd4c
commit
708bc55de7
37 changed files with 363 additions and 1234 deletions
|
|
@ -13,11 +13,11 @@ local function renderHook<Props, Result>(callback: (Props) -> Result, props: Pro
|
|||
local root = ReactRoblox.createLegacyRoot(Instance.new("Folder"))
|
||||
local hook = {}
|
||||
|
||||
local function Component(props)
|
||||
local function Component(props: Props)
|
||||
hook.result = callback(props)
|
||||
end
|
||||
|
||||
function hook.rerender(newProps)
|
||||
function hook.rerender(newProps: Props?)
|
||||
props = newProps or props
|
||||
ReactRoblox.act(function()
|
||||
root:render(React.createElement(Component, props))
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
local suite = require("../../../../test/suite")
|
||||
|
||||
suite.describe("react-charm", function()
|
||||
if not game then
|
||||
return suite.skip()
|
||||
end
|
||||
suite.describe("useAtom", function()
|
||||
require("./useAtom.spec")
|
||||
end)
|
||||
suite.describe("useAtomBinding", function()
|
||||
require("./useAtomBinding.spec")
|
||||
end)
|
||||
suite.describe("useAtom", function()
|
||||
require("./useAtom.spec")
|
||||
end)
|
||||
|
||||
suite.describe("useAtomBinding", function()
|
||||
require("./useAtomBinding.spec")
|
||||
end)
|
||||
|
||||
return {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue