You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the last version of react-markdown (v6.0.3), the following TypeScript code snippet will work fine with the plugins remark-gfm and remark-unwrap-images on versions v1.0.0 and v2.1.0 respectively.
However, if I update any of the plugin from that version (the immediately previous one) to the last version, I get the following errors for each:
For remark-gfm:
Type error: Type '(options?: void \| Options \| undefined) => void \| Transformer<Root, Root>' is not assignable to type 'Pluggable<any[], Settings>'.
--
Type '(options?: void \| Options \| undefined) => void \| Transformer<Root, Root>' is not assignable to type 'Plugin<any[], Settings>'.
Type 'void \| Transformer<Root, Root>' is not assignable to type 'void \| Transformer'.
Type 'Transformer<Root, Root>' is not assignable to type 'void \| Transformer'.
Type 'Transformer<Root, Root>' is not assignable to type 'Transformer'.
Types of parameters 'node' and 'node' are incompatible.
Property 'children' is missing in type 'Node' but required in type 'Root'.
<ReactMarkdown
remarkPlugins={[gfm, rum]}
^
>
For remark-unwrap-images (note the errors refers gfm, but I have only updated remark-unwrap-images, so there could be a type inference problem with the TS compiler):
Type error: Type 'Gfm' is not assignable to type 'Pluggable<any[], Settings>'.
--
Type 'Gfm' is not assignable to type 'Plugin<any[], Settings>'.
The 'this' types of each signature are incompatible.
Property 'attachers' is missing in type 'Processor<Settings>' but required in type 'Processor<void, Node, void, void>'.
<ReactMarkdown
remarkPlugins={[gfm, rum]}
^
>
Expected behavior
Not to get errors and execute it properly
Actual behavior
Getting the errors I posted
Runtime
Node v14
Package manager
yarn v1
OS
Linux, macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered:
Initial checklist
Affected packages and versions
react-markdown v6.0.3, remark-gfm v2.0.0, remark-unwrap-images v3.0.0
Link to runnable example
No response
Steps to reproduce
With the last version of
react-markdown
(v6.0.3), the following TypeScript code snippet will work fine with the pluginsremark-gfm
andremark-unwrap-images
on versions v1.0.0 and v2.1.0 respectively.However, if I update any of the plugin from that version (the immediately previous one) to the last version, I get the following errors for each:
For
remark-gfm
:For
remark-unwrap-images
(note the errors refers gfm, but I have only updatedremark-unwrap-images
, so there could be a type inference problem with the TS compiler):Expected behavior
Not to get errors and execute it properly
Actual behavior
Getting the errors I posted
Runtime
Node v14
Package manager
yarn v1
OS
Linux, macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered: