3 ms·
You can use useRef in React to get a DOM node and pass it to other parts if needed. Saying that every framework should be possible to combine with every other
by jbergens 7y ago
You can use useRef in React to get a DOM node and pass it to other parts if needed.
Saying that every framework should be possible to combine with every other sounds very nice but probably impossible. Unless you restrict what you can do in a framework a lot. Most frameworks has components that has an api and a life cycle. Since frameworks have different api's and life cycles they are hard to combine in one application. Not impossible but hard.
I have a feeling this is somewhat true for Svelte also. How would I how to update a state inside a Svelte component from the outside?
There is a standard for components, Web Components, but it did not exist when Angular and React was created. It also works in a different way and don't solve the exact same use cases.
- excerionsforte 7y agoI am aware of useRef. > Saying that every framework should be possible to combine with every other sounds very nice but probably impossible. I said specifically that I disliked frameworks that want me to conform. I did not say that all frameworks should conform to me. > How would I how to update a state inside a Svelte component from the outside? How would you update a Web Component is the same way this works. https://dev.to/silvio/how-to-create-a-web-components-in-svelte-2g4j https://dev.to/silvio/how-to-create-a-web-components-in-svel...