GitXplorerGitXplorer
a

remirror-contrib-example

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
f8e388960d8fbcf70355ae6438309d038da4016e

https://github.com/ifiokjr/remirror/issues/174

aaarongreenlee committed 5 years ago
Unverified
997027fd382dd3f08016da5799fa458abc6e84c9

Updated assembly in readme

aaarongreenlee committed 5 years ago
Unverified
521f4acc989da7d9511e75a916e98bbb6d92896e

Added stacktrace

aaarongreenlee committed 5 years ago
Unverified
1d50f2752f3d91601b03791bf473429d15c27939

Further simplified example

aaarongreenlee committed 5 years ago
Unverified
0fd18c1a9cbc05b3256d62e50737bde0f2ae2279

Added example to file remirror issue

aaarongreenlee committed 5 years ago
Unverified
d875ad257abc060654dce203af9e36b200cfe246

first commit

aaarongreenlee committed 5 years ago

README

The README file for this repository.

remirror-contrib-example

A repo to aid in the reporting of https://github.com/ifiokjr/remirror/issues/174

Error

this is undefined within collaboration-extention.ts

  /**
   * Called whenever a transaction occurs.
   */
  public onTransaction({ getState }: OnTransactionParams) {
    this.getSendableSteps(getState()); // <<< 'this' is undefined
  }
react-dom.development.js:12194 Uncaught TypeError: Cannot read property 'getSendableSteps' of undefined
    at onTransaction (extension-collaboration.esm.js:147)
    at eval (core.esm.js:1344)
    at Array.forEach (<anonymous>)
    at ExtensionManager.onTransaction (core.esm.js:1342)
    at onUpdate (react.esm.js:483)
    at Remirror.eval (react.esm.js:515)
    at callCallback (react-dom.development.js:13811)
    at commitUpdateEffects (react-dom.development.js:13849)
    at commitUpdateQueue (react-dom.development.js:13837)
    at commitLifeCycles (react-dom.development.js:22101)

Editor Assembly

The following can be found at simple-editor/index.tsx

import {
    ManagedRemirrorProvider,
    RemirrorManager,
    RemirrorExtension,
    useRemirrorContext,
} from "@remirror/react";

import {CollaborationExtension, OnSendableReceivedParams} from "@remirror/extension-collaboration";

import React, {FC} from "react";

export const SimpleEditor: FC = () => {
    return (
      <RemirrorManager>
          <RemirrorExtension
            Constructor={CollaborationExtension}
            clientID='fooBar'
            onSendableReceived={(p: OnSendableReceivedParams) => {
                console.log('onSendableReceived', p);
            }}
          />
          <ManagedRemirrorProvider>
              <InnerEditor/>
          </ManagedRemirrorProvider>
      </RemirrorManager>
    )
};

/**
 * The internal editor responsible for the editor layout and ui.
 * Any component rendered has access to the remirror context.
 */
const InnerEditor: FC = () => {
    const {getRootProps} = useRemirrorContext();

    return (
      <div {...getRootProps()} data-testid='remirror-wysiwyg-editor'/>
    )
};