Skip to content

'editor' is not defined, and unable to access editor methods in react hooks #621

Open
@linonetwo

Description

@linonetwo

function fitGraphInView() {
editor.triggerFit();
}

This is undefined.

And how to access those exitor.xxx methods?

const appContainerReference = useRef<HTMLDivElement>(null);

<TheGraph.App
ref={appContainerReference}
/>

This only get null and said

React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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