Closed ceifa closed 2 years ago
This is not a bug and has been discussed before. Seeing the most recent comments on the linked issue from Svelte, I am thinking that following the workaround from Routify could be done: disabling console.warn
completely during the initialisation of our component. I'll toy with that. Feel free to leave this issue open!
Hey, just saw it was fixed on https://github.com/pablo-abc/svelte-markdown/commit/2125e51a2e6aa7dda574b6a54be61ceeaf38a7dc, very good! It's a great solution but I don't know if it's the best. The difference from svelte-markdown and the Routify is that in Routify the user create the component, since in svelte-markdown all components is in the library maybe we can refact to receive only the props the component needs.
Something like that would work:
{#if type == "paragraph"}
<svelte:component this={renderer[type]}>
{:else}
<svelte:component this={renderer[type]} {...$restProps}>
{/if}
Part of the features of this package is that we do allow to write your own components. In the case of paragraph, for example, you might override it with your own component that takes the 'text' or 'raw' prop and does something with this. So unused props are to be expected.
Oh, thanks for the explanation! :) Closing since it was fixed.
I'm getting this error a lot on svelte-kit:
<Paragraph> was created with unknown prop 'raw'
This is probably a bug.