switch to pretty-roact-hooks
This commit is contained in:
parent
057efc9a8c
commit
079af9709f
4 changed files with 25 additions and 20 deletions
|
@ -1,10 +1,10 @@
|
|||
import Roact from "@rbxts/roact"
|
||||
import { ContextActionService, HttpService } from "@rbxts/services"
|
||||
import { Spring } from "@rbxts/flipper"
|
||||
import { useGroupMotor } from "@rbxts/roact-hooked-plus"
|
||||
import { useEffect } from "@rbxts/roact-hooked"
|
||||
import Item from "./item"
|
||||
import Surface from "ReplicatedStorage/ui/components/surface"
|
||||
import { useMotor } from "@rbxts/pretty-roact-hooks"
|
||||
|
||||
interface ConfigProps extends Roact.JsxInstanceProperties<Frame> {
|
||||
shown: boolean
|
||||
|
@ -13,8 +13,8 @@ interface ConfigProps extends Roact.JsxInstanceProperties<Frame> {
|
|||
Change?: Roact.JsxInstanceChangeEvents<Frame>
|
||||
}
|
||||
|
||||
const CONFIG_DEFAULT = [new Spring(1.5, { frequency: 6 })]
|
||||
const CONFIG_ACTIVE = [new Spring(.5, { frequency: 6 })]
|
||||
const CONFIG_DEFAULT = new Spring(1.5, { frequency: 6 })
|
||||
const CONFIG_ACTIVE = new Spring(.5, { frequency: 6 })
|
||||
|
||||
function config(props: ConfigProps): Roact.Element {
|
||||
let { shown } = props
|
||||
|
@ -22,8 +22,7 @@ function config(props: ConfigProps): Roact.Element {
|
|||
const spreadableProps = { ...props } as Partial<ConfigProps>
|
||||
delete spreadableProps.shown
|
||||
|
||||
const [configPosYMap, setConfigGoal] = useGroupMotor([1.5])
|
||||
const configPosY = configPosYMap.map((t) => t[0])
|
||||
const [configPosY, setConfigGoal] = useMotor(1.5)
|
||||
|
||||
useEffect(() => {
|
||||
const guid = HttpService.GenerateGUID(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue