-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject custom prop to remirror context #291
Comments
This is an interesting suggestion. In the However, I’m not sure I see the benefit in adding extra props to the context of the react provider. Could you shed more light on what it is you’re trying to achieve and how passing the extra props will make that possible? |
My use case is that my extensions would need to access remote resources, through graphql. The graphql client could be passed down through extension options, but since the client is a shared resource, it would be nice to put it in editor context. And functions that would be called by the extensions can access the client conveniently without the need to further pass the client down as function variable. Generally speaking, context is a nice place for shared resources. |
What would you suggest the API should look like? Perhaps it's a change that can be added to the |
May be as a prop of |
Thinking about this again. It seems possible to just create your context provider that can also be used within the editor. Adding this to |
Description
useRemirrorContext
is very convenient. I need to pass some extra props foruseRemirrorConext
to capture, for example a GraphQL client instance.Is there a way to do it now? If not, can I propose such a feature. For max flexibility, it should use a template type for user to define what to pass to the context.
Thanks in advance
Possible Implementation
Checklist
The text was updated successfully, but these errors were encountered: