Skip to content

Commit

Permalink
fix(ckeditor-5-build-custom): react version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dackmin committed Dec 10, 2024
1 parent 2f162dd commit 134dc89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ckeditor5-build-custom/lib/ColorPlugin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class ColorPlugin extends Plugin {

async createReactRoot (element: HTMLElement) {
try {
if (version.startsWith('18')) {
if (Number(version.split('.')[0]) >= 18) {
const { createRoot } = await import('react-dom/client');

return createRoot(element);
Expand All @@ -108,6 +108,7 @@ export default class ColorPlugin extends Plugin {
);
}

// @ts-expect-error react <= 17 fallback
const { render } = await import('react-dom');

return {
Expand Down

0 comments on commit 134dc89

Please sign in to comment.