by flowerlad · 7y ago · 0 comments
<ProductPicker />
You can implement it as a React component in which case it only works in React applications, and will be brittle because of the global nature of js and css.You can implement the same element as a Web Component and now it will work in any application regardless of framework... you can just drop in and it will work. If your application has conflicting css classes or element ids or javascript variables the Web Component will still work reliably. That’s hot! React components will feel a bit cold as cross-framework Web Components take over.
Sure, things have changed (e.g. TypeScript is far more accessible today), but if you've been doing React for the past few years, the changes haven't been that drastic, and primarily for the better (e.g. Create React App, that mainly allowed you to forget things, rather than having to learn new things).
Focus is broken so you can't tab between inputs. For example, if you compose forms using web components, you'll lose keyboard control over focus movement in your app.