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

Enable updates to extension options via props #41

Closed
ifiokjr opened this issue Mar 9, 2019 · 1 comment
Closed

Enable updates to extension options via props #41

ifiokjr opened this issue Mar 9, 2019 · 1 comment
Labels
package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. type: feature ✨ A new feature is being added to the public API

Comments

@ifiokjr
Copy link
Member

ifiokjr commented Mar 9, 2019

Detailed Description

Currently, once a component is built the options passed into the extensions can no longer be updated.

Test some methods of enabling extensions to be updated via the passing of props.

Possible Implementation

Something could be learned from the implementation that tiptap is using

@ifiokjr ifiokjr added type: feature ✨ A new feature is being added to the public API @remirror/core labels Mar 9, 2019
@ifiokjr
Copy link
Member Author

ifiokjr commented Jul 11, 2019

I've decided against this. It is not advisable to update schema on the fly since it can have unintended effects.

Also, using the RemirrorManager we can effectively reconfigure props for any extensions on the fly. Each change leads to a change in the underlying ExtensionManager and causes the RemirrorEditor to update its functionality.

const EditorLayout: FunctionComponent = () => {
  return (
    <RemirrorManager>
      <RemirrorExtension Constructor={Bold} />
      <RemirrorExtension Constructor={Italic} />
      <RemirrorExtension Constructor={Underline} />
      <ManagedRemirrorProvider
        attributes={{ 'data-testid': 'editor-instance' }}
        onChange={onChange}
        placeholder='Start typing for magic...'
        autoFocus={true}
        initialContent={EMPTY_OBJECT_NODE}
      >
        <SimpleFloatingMenu />
      </ManagedRemirrorProvider>
    </RemirrorManager>
  );
};

However, it is not advised that you do this for certain properties.

@ifiokjr ifiokjr closed this as completed Jul 11, 2019
@ifiokjr ifiokjr added package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. and removed @remirror/core labels Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. type: feature ✨ A new feature is being added to the public API
Projects
None yet
Development

No branches or pull requests

1 participant