triplex
triplex copied to clipboard
Errors originating from hooks can be cryptic depending on the error message
React generally doesn't throw errors in hooks, they're thrown in userland (either from a dependency or their own code). We can aid Triplex users by giving them more actionable information of where the error originated from.
Since hooks need to start with use we can use the stack trace and infer if it's from a hook or not. We could stretch this to more use cases if it works well.
The main goal for this issue is to make any errors originating from hooks as obvious as possible with a. guide for how to resolve, e.g. adding global provider context.