
React Three UI – Experimenting with React as an Interface for 3D UIs - iLoch
https://github.com/lwansbrough/react-three-ui
======
iamleppert
I'm sorry but I had a really bad visceral reaction to the sample code. All of
the declarative 3D languages haven't been very successful, and for good reason
-- they generally just get in the way.

Three.js is such a joy to code in because it has a great API and works well
with functional javascript.

Not everything needs to be declarative, and if you need a model for your
three.js application there's nothing preventing you from using something
immutable.

~~~
leeoniya
1M times this. The desire to wrap everything in declarative constructs just
forces you to learn more and more proprietary DSLs for a curated subset of
features. Eventually you _will_ run into roadblocks and have to fall back to
imperative.

The trend to React-wrap all the things is truly baffling to me. Some problems
are just not meant for this. It works well for HTML/CSS and UIs because these
have always been declarative, so is a natural fit and is a superset plus
sugar.

~~~
evv
> Eventually you _will_ run into roadblocks and have to fall back to
> imperative.

This is the case with low-level components, which is why React's lifecycle
methods make it so easy to fall back on imperative code.

> The trend to React-wrap all the things is truly baffling to me. Some
> problems are just not meant for this. It works well for HTML/CSS and UIs
> because these have always been declarative, so is a natural fit and is a
> superset plus sugar.

My mind may be twisted from working with React every day, but I would say that
a declarative API tends to be more natural when building real world
applications. Not just for HTML and UI. At Facebook for example, we
declaratively describe the data needs of each component and mutation using
GraphQL and Relay.

------
bhouston
Is there an example of a working app?

~~~
iLoch
Nope sorry, this is still very experimental.

------
bcjordan
Was looking around to try to get an example of this running & came across
[https://github.com/toxicFork/react-three-
renderer](https://github.com/toxicFork/react-three-renderer) — is that
similar?

~~~
iLoch
Sort of, but not really. That library is sort of solving the same problem that
React Three solves. React Three UI allows you to design 2D UIs (using flexbox,
animations, etc.) that can be placed in 3D space using the existing React
Three API.

