3 ms·
That doesn't look like what I was talking about. He basically has an entire new component for every possible state - and his state is just a single variable. T
by realharo 9y ago
That doesn't look like what I was talking about. He basically has an entire new component for every possible state - and his state is just a single variable.
That seems very wasteful if what you want to do is just to show a bunch of extra controls if a small part of the state changes.
Later when he works with bindings, that's closer, but the expression still had to be written in as code, so no win there. Plus it's classic data-binding, where it can only affect pre-defined properties (usually of primitive types), but not the entire structure of the component.
- TuringTest 9y ago> That doesn't look like what I was talking about. He basically has an entire new component for every possible state - and the state here is just a single variable. With reactive programming being primarily functional, it should be relatively easy to refactor the output of a tool like this. You could split the states into its common components, maybe even using visual tools in the designer itself without having to touch the generated code. I don't know if this tool will be able to do that, but I've seen that approach used in mockup tools for rapid prototyping. The only part missing in those tools to allow the interface designer to build the interaction logic by themselves was a sane code generator. With a language like React, I believe the generated code will resemble something usable, which was impossible when UI designers generated imperative or object-oriented code.