React dependency
See original GitHub issueWhat:
Is it possible to remove the react dependency? Meaning are you using features that are specific to React to achieve this (by curiosity which?)? I wonder if this could be packaged in a web component, leveraging the native slot mechanism.
Why:
This would extend the audience of the component to other frameworks but more importantly vanilla-JS.
How:
I don’t know about the underlying code for this component. However, the web component standard allows you to get components children as slots. You could use the slot name to indicate placeholding for the Thumbnail, Header, Footer components. Haven’t given too much thoughts about that, but what I have in mind is something like this:
<Composition areas={areasMobile} areasMd={areasTablet} gap={20}>
<slot name='Thumbnail'>
<Thumbnail src={imageUrl} alt={title} />
</slot>
<h3><slot name-'Header' >{title}</slot></h3>
<slot name='Footer' padding={10} paddingMd={20}>
<Footer>...</Footer>
</slot>
</Composition>
The Stencil compiler may help along the way with some of that work.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Installing a Dependency - Create React App
Installing a Dependency. The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create ...
Read more >What exactly means dependency in react.js? - Stack Overflow
A dependency is just a package that your project uses. Very few javascript projects are entirely self-contained.
Read more >Add a Dependency to React in package.json for a ... - Pluralsight
Developing apps in React involves external dependencies as reusable components published by other React developers that you can use in your ...
Read more >Hooks API Reference - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. This page...
Read more >React - npm
React is a JavaScript library for building user interfaces. ... There are 97555 other projects in the npm registry using react.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Artem, that’s duly noted. I am still busy with writing a clone of the conduit app with my state machine library. But I already had a look with Svelte, and it looks a little bit more complicated than I thought, when it comes to styling. But I’ll get back to it in 2020. Happy new year in advance!
Bruno Couriol Twitter: https://twitter.com/bricoi1
On Thu, Dec 26, 2019 at 10:59 AM Artem Zakharchenko < notifications@github.com> wrote:
Thanks for the additional information! I will let you know when I reach a conclusion,