Skip to content

useCodeMirror overwrites content if not provided via prop #441

@mrdrogdrog

Description

@mrdrogdrog

Greetings

Hello 👋 Nice work. ❤️

Problem

In useCodeMirror.ts you have an effect which overwrites the document content every time the variable value changes.
I use the react-codemirror component in a project where the content comes from a codemirror extension and not via your prop but the effect still triggers on init and overwrites my initial content.

Prefered solution

I can't provide the content via the prop so it would be nice to disable this effect. Please don't execute the dispatch in the effect if no content (null or undefined) was given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions