Replies: 2 comments 3 replies
|
The simplest way is just to render the
Disadvantages:
|
3 replies
|
We do in fact have a static prop, now! If you set it, React ProseMirror will never hydrate a full Editor View — it will just render your ProseMirror tree using your node view components. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi!
First of all, I want to thank you for a great package that saved me a lot of time!
And I hope that here I will be helped with the following question. After we have created and edited the document, we need to show it to users. I do it like this:
`
import { FC, useEffect, useRef, useState } from 'react';
import { DOMSerializer, Node } from 'prosemirror-model';
import { schema } from './schema';
import './ProseViewer.css';
type ProseViewerProps = {
content: string;
};
const ProseViewer: FC = ({ content }) => {
const ref = useRef(null);
const [ error, setError ] = useState(false);
};
export default ProseViewer;
`
The document displays fine, but there is one problem: suppose I want some components to be active. For example, I want a full-screen lightbox to appear when you click on an image. If I displayed the image in the editor, then there would be no problems with this - you can use nodeViews props in the ProseMirror component. But I don't need an editor right now, I only need a document viewer.
What do you think is the best approach to solving this problem?
All reactions