Skip to content

Commit

Permalink
Error importing HtmlReactParser in index.cjs file #44
Browse files Browse the repository at this point in the history
  • Loading branch information
pmi authored and alansemenov committed Oct 3, 2024
1 parent 622c63a commit ef229aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function RichText<RestProps = Record<string, unknown>>({
data.processedHtml
/* try parser.default.default first because import is wrapped with __toesm() in cjs files
* for node compatibility, which adds default export resulting in parser.default.default */
? (parser.default['default'] || parser.default)(data.processedHtml, {
? (((parser.default as any).default as typeof parser.default) || parser.default)(data.processedHtml, {
replace: createReplacer({
...rest,
// These should be last, so they can't be overridden
Expand Down

0 comments on commit ef229aa

Please sign in to comment.