r/reactjs • • Jul 28 '19

Show /r/reactjs ScriptUI: Write React without JSX

https://github.com/anater/ScriptUI
3 Upvotes

26 comments sorted by

View all comments

1

u/[deleted] Jul 28 '19

Hi /r/reactjs!

I'm the author of ScriptUI. I whipped it up over the last few weekends as a proof of concept. I'm looking for feedback on whether you'd use something like this. I hope it helps make starting projects easier.

Thanks for reading!

0

u/[deleted] Jul 28 '19

[deleted]

1

u/[deleted] Jul 28 '19

Good question! Thanks for checking this out. I don’t have a bunch of examples but I see how that could be helpful.

The friction is in the required tooling to use JSX. Node, npm, Babel. Without that tooling, you can use React.createElement. But that’s too long so you’ll need some alias. const h = React.createElement but this gets noisy because your element type, props, and children are all jammed into a single function call. So the abstraction is meant to break up the component definition more cleanly. This is inspired by how SwiftUI defines UI.

3

u/DeadPlutonium Jul 28 '19

Lotta respect for building a mini-API or new approach to solve tooling difficulties, must have been a good project to learn from if nothing else!