Closed jzecca closed 3 years ago
This is solvable in userland just bind can
and whatever properties you want to provided Ability
instance. This is what I did in one of the casl-examples
I close this as I don't plan to change the behavior at least for now. But feel free to express your thoughts here
Binding can
& cannot
did the trick. Thanks a lot!
Using destructuring on CASL React context fails with the following error:
To Reproduce
Expected behavior I expected this to work, obviously. For the sake of readability, I'd really prefer to call
can()
rather thanability.can()
in my components.Interactive example Here's a reproducer : just change
export default Test1
toexport default Test2
on L23.This took me forever to figure out, as I didn't (and still don't) see any reason for this to fail. Am I missing something here?
Thanks in advance!
EDIT: I think this might be the reason for issue #407