-
Notifications
You must be signed in to change notification settings - Fork 958
Closed
Labels
Description
Description
Built files make use of the react/jsx-runtime module, but list "react" >= "16.8.0" in their peerDependencies. The result is an error when consuming this package with an app using anything < 17.0.0.
Steps
When you build the packages, look at the dist/index.es.js and you'll see the use of react/jsx-runtime, which isn't present before React 17, here's the alignment-ui package contents:
import 'react';
import { KEYS_ALIGN, upsertAlign } from '@udecode/plate-alignment';
import { someNode, getPreventDefaultHandler } from '@udecode/plate-common';
import { useStoreEditorState, useEventEditorId } from '@udecode/plate-core';
import { ToolbarButton } from '@udecode/plate-toolbar';
import { jsx } from 'react/jsx-runtime';
const ToolbarAlign = ({
type,
unwrapTypes = KEYS_ALIGN,
...props
}) => {
const editor = useStoreEditorState(useEventEditorId('focus'));
return /*#__PURE__*/jsx(ToolbarButton, {
active: !!(editor !== null && editor !== void 0 && editor.selection) && !!type && someNode(editor, {
match: {
type
}
}),
onMouseDown: editor ? getPreventDefaultHandler(upsertAlign, editor, {
type,
unwrapTypes
}) : undefined,
...props
});
};
export { ToolbarAlign };
//# sourceMappingURL=index.es.js.mapExpectation
Be able to run this on an app using React < 17
Environment
- slate: 0.66.0
- slate-react: 0.66.0
- browser: chrome
Reactions are currently unavailable