What do I use in place of 'createCanBoundTo()' #1017
|
REF: in version 5 of '@casl/react' the createCanBoundTo() function was removed Q: I was using that function to create a Can attached to my application-wide context. How should I proceed given the new paradigm? |
Replies: 5 comments 2 replies
|
I see the BoundCanProps are still present in Can.ts in 5.0. Trying to figure out how to implment a bound Can using my ability in the application context. Any thoughts? |
|
It looks like the base Can class component can change its ability subscription after the fact, yet the methods to do so are private. |
|
I am not well versed in class components as I am in function components; so I might be missing something obvious here. |
|
I guess it should be stated that I really don't want to create a separate application-wide context just for the Can. |
|
You need to use this is written in docs. |
You need to use
createContextualCan.createCanBoundTowas added to support version of react which doesn’t support contextsthis is written in docs.