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

Invalid content for node doc: <> #2

Closed
IslamRustam opened this issue Apr 19, 2024 · 2 comments
Closed

Invalid content for node doc: <> #2

IslamRustam opened this issue Apr 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@IslamRustam
Copy link

Installed this lib with npm i and after I call useEditor hook I get this error:
simulator_screenshot_0890B8BA-2F42-42CD-8A2C-F9FAF198A8B7

Code looks like this:

import { EditorContent, extensions, useEditor } from 'rn-text-editor';
// ...
 const inputRef = React.useRef<TextInput>(null);
    const editor = useEditor({
        enableCoreExtensions: true,
        onUpdate(props) {
            console.log(props.editor.contentAsJson());
        }
    });

    return (
        <EditorContent
            editor={editor}
            placeholder="Write something..."
            inputRef={inputRef}
            autoFocus
        />
    );
// ...

Have any ideas about this error and how to fix it?

@amjadbouhouch
Copy link
Owner

amjadbouhouch commented Apr 19, 2024

Hi @IslamRustam
Make sure you install the beta version

npm i rn-text-editor@0.2.0-beta.3

the docs: https://www.npmjs.com/package/rn-text-editor/v/0.2.0-beta.3
Example: https://github.com/amjadbouhouch/rn-text-editor/tree/v0.2.0-beta.3/example

& It's not stable; there is a lot of work that needs to be done. Due this facebook/react-native#29063 (comment)

@amjadbouhouch amjadbouhouch added the bug Something isn't working label Apr 19, 2024
@IslamRustam
Copy link
Author

Using beta version indeed fixed it, but editor itself does require some work. Hopefully you will manage to achieve what you plan to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants