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

Uncaught Error: Got unexpected null or undefined #1419

Open
NikitaLukashuk1 opened this issue Jan 25, 2024 · 0 comments
Open

Uncaught Error: Got unexpected null or undefined #1419

NikitaLukashuk1 opened this issue Jan 25, 2024 · 0 comments

Comments

@NikitaLukashuk1
Copy link

NikitaLukashuk1 commented Jan 25, 2024

Please, help me to solve this case!
App sometimes crushes, by no reasons, I mean, I just write something, send, and suddenly it crushes, why It's like that?
The internal span , which is built in app disappears , it's like, the state stops being existed
The code below is for setting up the editor

 return (
    <div className="rich-text-editor">
      <Editor
        mention={{
          separator: " ",
          trigger: "@",
          suggestions: users
            ? users.map((user) => ({ text: user.name, value: user.name }))
            : [],
        }}
        handleReturn={(e, editorState) => {
          handleReturn({
            e,
            editorState,
            setEditorState,
            sendMessage,
            messageText,
            thread,
            rawEditorContent,
            isDisabled,
          });
        }}
        handleKeyCommand={(command, editorState) => {
          handleKeyCommand({
            command,
            editorState,
            setEditorState,
          });
        }}
        keyBindingFn={sendBindingFn}
        toolbar={{
          options: ["inline", "list", "emoji"],
          inline: {
            inDropdown: false,
            options: ["bold", "italic", "strikethrough"],
          },
          list: { inDropdown: false },
        }}
        editorState={editorState}
        onEditorStateChange={setEditorState}
        toolbarClassName="toolbarClassName"
        wrapperClassName="wrapperClassName"
        editorClassName="editorClassName"
      />
      <div
        style={{
          width: "100%",
          height: "max-content",
          display: "flex",
          justifyContent: "flex-end",
        }}
      >
        <SendButton
          onClick={() => {
            handleSend({
              sendMessage,
              rawEditorContent,
              setEditorState,
              thread,
              messageText,
              users,
            });
          }}
          isDisabled={isDisabled}
        />
      </div>
    </div>

);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant