new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

React Router · API · all subjects

hooks signatures

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

useBlocker hook basic usage

The useBlocker hook accepts a function that returns a boolean indicating whether to block navigation. It returns a blocker object with state and control methods. Use it by calling useBlocker(useCallback(() => isDirty, [isDirty])) where isDirty is a boolean dependency.

useBlocker blocker object state property

The blocker object returned by useBlocker has a state property that can be 'idle' (default) or 'blocked' when navigation is prevented. Check blocker.state === 'blocked' to determine if a navigation attempt is currently blocked.

useBlocker blocker object methods

The blocker object has two methods: blocker.proceed() to allow the blocked navigation to continue, and blocker.reset() to cancel the navigation attempt and stay on the current page.

Give your agent this brain