On Github: http://andrewrota.github.io/complementarity-of-react-and-web-components-presentation/index.html
The component driven, performance focused approach of React is a perfect complement to the modularity and portability of native HTML Web Components. At first glance, React and Web Components might seem like two radically different solutions to the same problem. But when combined properly they complement each other to create an extremely powerful, expressive framework for developing complex web applications.
3. Web Components
Web Components usher in a new era of web
development based on encapsulated and
interoperable custom elements that extend
HTML itself. — Polymer Project
6. Shadow DOM
// Create Shadow Root
var s = document.getElementById('my-element').createShadow
// Add Styles and Text
s.innerHTML += '<style>p { color: red; }</style>';
22. ERROR in ./src/js/init.js
Module build failed:Error: Lower case component
names (my-custom-element) are no longer
supported in JSX: See
http://fb.me/react-jsx-lower-case
23. “The Whitelist Problem”
“Every time there's a new HTML/SVG tag, you can't
use it until we add it to the whitelist. You can't add
it to the whitelist until you update your existing
codebase.”
— (Oct. 5, 2014)Sebastian Markbåge
24. v0.12-rc1
“To address this, we decided on a convention:
All JSX tags that start with a lower-case letter
or contain a dash are treated as HTML.
…This also introduces the possibility to consume
custom elements (Web Components)”
— (Oct. 16, 2014)Sebastian Markbåge
48. Web Components Should Be…
- Small
- Extremely Encapsulated
- As Stateless as Possible
- Performant
49. tl;dr Web Components should seem no
different than native DOM elements.
corollary: Use Web Components in React.js
as if they were native DOM elements.