Comments (6)
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.
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.
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.
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.
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.
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)
- Demo link points to unrelated project HOT 2
- Add ability to add/remove svelte components from example? HOT 1
- Minimal example in readme does not work without one extension HOT 2
- how to dynamically update the editor content ?
- Critical error when trying to use with SvelteKit 1.0 HOT 13
- Packaging Upgrades HOT 2
- Cursor can not be moved upwards out of svelte editable component HOT 3
- Typescript types are not in the dist HOT 5
- Editable component doesn't allow backspace or most editing operations if initial content is empty. HOT 1
- Support of Mention/Suggestion extension HOT 1
- No idea what to do... HOT 1
- Help with the `isActive` reactivity HOT 4
- Whole node is draggable HOT 5
- Could not resolve "@tiptap/extension-floating-menu" HOT 2
- What is the purpose of svelte-component-selected? HOT 2
- Bubble menu glitches when the editor changes positions HOT 5
- Demo site and basic tutorial don't work HOT 2
- Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'element') at init HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-tiptap.