Components as classes and/or traits (ES6?)
See original GitHub issueReact is moving towards ES6 classes being the default form of existence for components. Voices in gitter all approve a similar transition in Scala.
Note: This will be in addition to ReactComponentB
which won’t be removed.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
As a JS Developer, This Is What Keeps Me Up at Night - Toptal
What are ES6 classes? In ES6, the "class" keyword and associated features are a new approach to creating prototype constructors. They are not...
Read more >ES6 Classes and Functional Components In Under 30 Minutes!
The list below contains some of the main features that each component has to offer: ES6 Class Components: Classes have more predefined methods ......
Read more >Classes and Inheritance: JavaScript ES6 Feature Series (Pt 8)
Each object in JavaScript has a prototype object, which acts as a template that it inherits methods and properties from. That same prototype ......
Read more >15. Classes - Exploring JS
Under the hood, ES6 classes are not something that is radically new: They mainly provide more convenient syntax to create old-school constructor functions....
Read more >Building web components using ES6 classes - Polymer Project
First, I'll cover how to create the element using the vanilla web component JS APIs and then how to create the same element...
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
Backends are getting closer and closer to components as classes. (63aea4a241f23f9a142e53926a4f5f49d176c7a3, #78)
Idea: with a small change we could do:
Can also set the DOM node type too:
Actually this is great. A type with no constraints at all (a class construtor param) can tell us all the static information about a component in one line with no repetition anywhere else. Can even have different
ReactComponentB
path depending on static info. This should makes it easy to solve #171 too.As of 1.0, Scala component builder now creates ES6 classes (by default) for your Scala components. There’s also a unit test confirming that one can directly extend the ES6 facade and use it like any other component in scalajs-react.