Skip to content
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

Let onMessage handlers coexist #250

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ahmed-sudowrite
Copy link

The current behaviour we have here is that if you pass your own onMessage handler, it will override the existing TenTap one, which is, I think, not the intended behaviour in most cases.

Therefore I just introduced another prop that makes this possible, while maintaining the original behaviour. Basically, if you use onMessage right now through tentap, and you upgrade to this version, nothing changes.

Copy link
Collaborator

@17Amir17 17Amir17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add exclusivelyUseCustomOnMessage to the docs?

export const RichText = ({
editor,
onMessage,
exclusivelyUseCustomOnMessage = true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use-case for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the prop? Keeping compatibility and maintaining current behaviour so I don't accidentally break peoples' setups. And in general the use-case for the pr is being able to use the onMessage prop of the webview without messing up tentap's own behaviour

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any case it's a very important feature for me, so I know there's a usecase haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants