Skip to content
This repository was archived by the owner on May 24, 2021. It is now read-only.

Error: Element ref was specified as a string (image_popover) but no owner was set. #255

@azizmashkour

Description

@azizmashkour

I am trying to add this editor to my React app without success and I am not able to understand the issue:

import Dante from "Dante2";
import { convertFromRaw } from "draft-js";

const Editor = () => {
  const [content, setContent] = useState(null);
  const editorRef = React.useRef();

  useEffect(() => {
  }, []);

  const save_handler = (editorContext, content) => {
    setContent(content);
  };

  const classes = useStyles();
  let danteProps = {
    data_storage: {
      url: "xxx",
      save_handler: save_handler,
    },
    upload_url: "http://localhost:9292/uploads/new",
    store_url: "http://localhost:3333/store.json",
    el: editorRef,
  };

  let contentState = {};
  try {
    contentState = convertFromRaw(content);
  } catch (e) {}

  return (
    <div className={classes.heroContent}>
      <Dante ref={editorRef} content={content}/>
    </div>
  );
};

export default Editor;

I am using:
"Dante2": "^0.5.0-rc5" and "react": "latest".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions