github remirror/remirror @remirror/react@1.0.35

2022-04-26

Patch Changes

  • Add a new hook useExtensionEvent. You can use it to add event handlers to your extension. It's simpler and easier to use than the existed useExtension hook.

    It accepts an extension class, an event name and a memoized handler. It's important to make sure that the handler is memoized to avoid needless updates.

    Here is an example of using useExtensionEvent:

    import { useCallback } from 'react';
    import { HistoryExtension } from 'remirror/extensions';
    import { useExtensionEvent } from '@remirror/react';
    
    const RedoLogger = () => {
      useExtensionEvent(
        HistoryExtension,
        'onRedo',
        useCallback(() => log('a redo just happened'), []),
      );
    
      return null;
    };
  • Update dependencies.
  • Fix a crash with React v18 in development mode.

  • Updated dependencies []:

    • @remirror/react-core@1.2.0
    • @remirror/extension-react-tables@1.0.35
    • @remirror/react-components@1.0.32
    • @remirror/react-hooks@1.0.32
    • @remirror/extension-react-ssr@1.0.23
    • @remirror/react-renderer@1.0.23
    • @remirror/preset-react@1.0.25
    • @remirror/react-ssr@1.0.23

Don't miss a new remirror release

NewReleases is sending notifications on new releases.