Giter Club home page Giter Club logo

Comments (6)

sibiraj-s avatar sibiraj-s commented on June 1, 2024 1

Hmm, what about consolidating to a single prop?

Would require a breaking change, but makes sense.

For now, the workaround can be used. I'll try to work on something this weekend.

from svelte-tiptap.

sibiraj-s avatar sibiraj-s commented on June 1, 2024

Yeah its annoying. The problem with this is that, we don't know what the component would use. hence passing all. I can't think of anything ATM. Open to suggestions.

May be context? 🤔

from svelte-tiptap.

aivo0 avatar aivo0 commented on June 1, 2024

I declare all possible props in the component with export let. That removes the runtime warnings from user's console. Still get build time warnings like the following, but it's much better than constant runtime warnings on every component render:
[vite-plugin-svelte] /src/lib/components/nodes/components/Sub.svelte:11:11 Sub has unused export property 'decorations'. If it is for external reference only, please consider using export const decorations

from svelte-tiptap.

ronkeiser avatar ronkeiser commented on June 1, 2024

Hmm, what about consolidating to a single prop?

export let nodeViewProps: NodeViewProps

I also found this thread with a related discussion: sveltejs/svelte#4652

A user recently suggested adding $$restProps as a workaround. This of course does work, but it feels very dirty to add this to every node component just to avoid compiler warnings. But maybe there's some better way to use it?

from svelte-tiptap.

einarpersson avatar einarpersson commented on June 1, 2024

Hmm, what about consolidating to a single prop?

export let nodeViewProps: NodeViewProps

I also found this thread with a related discussion: sveltejs/svelte#4652

A user recently suggested adding $$restProps as a workaround. This of course does work, but it feels very dirty to add this to every node component just to avoid compiler warnings. But maybe there's some better way to use it?

How would you use $$restProps here without causing another warning/lint-warning? (since I don't "need" it)

from svelte-tiptap.

sibiraj-s avatar sibiraj-s commented on June 1, 2024

May be this will be fixed in svelte 5.

See https://svelte.dev/blog/runes#runtime-reactivity

you could do something like.

let nodeViewProps = $props()

from svelte-tiptap.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.