The example was in React but I don’t see how that prevents potentially using this with other frameworks or languages.
That said, I feel like this is learning something like CoffeeScript. You have to learn all this language specific syntax (though simplified), why not just learn the language itself at that point?