News for hackers. Stuff that matters.
Re:How to write PureScript react components to replace JavaS... by ddek on Friday June 26, 2020 @04:32AM (#23649911)
There is a change I’d make though - I’d memo-ise the click handler with useCallback. By using the function ‘overload’ on setState, which is guaranteed not to change, the callback will only be calculated (?) when the onclick handler changes. The setState would look like this: setState(c => c + 1);. Right now, the callback is interpreted on every render cycle.

There are no comments on this comment yet.