ViewModel for React Alpha


#82

Can you use recompose or higher order components with this?


#83

The short answer is that a VM component is a managed React component. You can wrap it however you want and the inner component will continue to behave the way it was designed.

For a long answer I need more info. Can you give an example of something you want to do? I ask because I’ve never heard of anyone wanting, much less needing, higher order components with VM.


#84

It’s only a compliance with convention concern.


#85

Would be cool if you could convert react to viewmodel and back as source code goes.


#86

That’s not possible in any satisfactory way. It’s like compiling another language to JavaScript. Yeah, the end result executes, but it’s far from what you’d write by hand.


#87

I imagine there’re some prettify layers through which them innards could be churned through, CS is somewhat pallatable.


#88

The problem is intent. CS motto is “it’s just Javascript”. Now imagine transpiling CS if it didn’t allow for map or reduce. You could definitely transpile it but you wouldn’t end up with idiomatic Javascript.