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

feat(react): add useEditorForImmediateRender hook #4858

Closed

Conversation

svenadlung
Copy link
Contributor

To be added …

Please describe your changes

[add a description of your changes here]

How did you accomplish your changes

[add a detailed description of how you accomplished your changes here]

How have you tested your changes

[add a detailed description of how you tested your changes here]

How can we verify your changes

[add a detailed description of how we can verify your changes here]

Remarks

[add any additional remarks here]

Checklist

  • The changes are not breaking the editor
  • Added tests where possible
  • Followed the guidelines
  • Fixed linting issues

Related issues

[add a link to the related issues here]

Copy link

netlify bot commented Feb 6, 2024

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit e905214
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/65c215fe13c1870008591ea9
😎 Deploy Preview https://deploy-preview-4858--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

// In case you want to render the editor immediately, you can use this hook.
// Caution: Does not work with SSR.
export const useEditorForImmediateRender = (options: Partial<EditorOptions> = {}, deps: DependencyList = []): Editor => {
const editor = useEditorBase(options, deps, true) as Editor
Copy link
Contributor

Choose a reason for hiding this comment

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

This a nice way to abstract the base editor logic unlike my PR. However, I highly recommend using memo instead of ref as the lifecycle becomes a lot more simpler (especially with editor cleanup)

@nperez0111
Copy link
Contributor

Resolved with: #5161

@nperez0111 nperez0111 closed this Jul 11, 2024
@nperez0111 nperez0111 deleted the feature/use-editor-hook-for-immediate-render branch August 14, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants