Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Change misleading code in Roact.Change example (#196)
Browse files Browse the repository at this point in the history
GetPropertyChangedSignal does not pass the new value of the property to the function and the Roact.Change handler doesn't add this functionality so the current example code is slightly misleading.
  • Loading branch information
DarraghGriffin authored and LPGhatguy committed May 2, 2019
1 parent fdf4d39 commit 4a8b70f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ It's similar to `Roact.Event`:

```lua
Roact.createElement("ScrollingFrame", {
[Roact.Change.CanvasPosition] = function(rbx, position)
print("ScrollingFrame scrolled to", position)
[Roact.Change.CanvasPosition] = function(rbx)
print("ScrollingFrame scrolled to", rbx.CanvasPosition)
end,
})
```
Expand Down Expand Up @@ -395,4 +395,4 @@ end
As with `setState`, you can set use the constant `Roact.None` to remove a field from the state.

!!! note
`getDerivedStateFromProps` is a *static* lifecycle method. It does not have access to `self`, and must be a pure function.
`getDerivedStateFromProps` is a *static* lifecycle method. It does not have access to `self`, and must be a pure function.

0 comments on commit 4a8b70f

Please sign in to comment.