F-Box React FAQ
Using useBox
Q: Why is my useBox
value not updating?
A: useBox
is designed for static state management. If you need reactive or frequently changing values, switch to useRBox
.
Q: How can I share a Box
instance across multiple components?
A: Define the Box
outside of your components and import it where needed. This ensures a single Box
instance is shared:
Using useRBox
Q: Why is my useRBox
value not updating?
A: Ensure you are using the set
function to update the RBox
value:
Q: How can I debug unexpected changes in a global RBox
?
A: Use the subscribe
method with console.trace()
to track where updates are coming from:
This will log the new value and a trace showing where the change originated.
Q: How do I combine multiple RBox
values into a single derived state?
A: Use the <*>
operator to combine multiple RBox
values:
Q: How can I store asynchronous data results into an RBox
?
A: Use Task.tryCatch
to fetch data and update the RBox
with the result:
Using useRBoxForm
Q: Why aren’t my validation errors showing up in useRBoxForm
?
A: Make sure your validation function returns the correct structure and that renderErrorMessages
is used properly:
Q: How can I debug form state changes in useRBoxForm
?
A: Use console.log
to inspect the current form state or validation results. You can also subscribe to changes in the form’s underlying RBox
for advanced debugging.