Open fernandosouza opened 7 years ago
IMHO this would add confusion to the table since there's no clear distinction between them.
Is this a proposal that it would be good rename state to props?
Yes, @ethib137. It's a proposal in order to make the learning processes easier. STATE static property in Soy Components behaves differently from JSX Components. In my humble opinion, this layer should be as similar as possible to both.
When I started using metal.js, I got confused because of that. I agree with @fernandosouza
Also, IMHO as a beginner with that would be easier to compare with JSX implementation and React. I got confused with the naming used for the static property STATE.
It also would be nice to see something like
{ state: true}
instead of {internal: true}
So that would be similar to compare with what it has on JSX.
Wouldn't this be a breaking change that would require us to update all metal components? Even if we had some kind of backwards compatibility, how would it work if one component used STATE
, and a dependency used PROPS
?
I think if we simply rename STATE
to PROPS
it might make more sense to a beginner, but we aren't really that much better off. STATE
in soy
is not the same as PROPS
in jsx
. If we want to avoid that confusion I think we would be better off pointing out the difference and possibly choosing a name that lines up with the soy
template. Renaming STATE
to PARAMS
.
I think @Robert-Frampton has an important point though. This would likely be a really difficult change regarding compatibility.
Yeah. Thank you for the feedback, guys. I agree that it is not an easy change. But it is something to think about, maybe. To find a way to avoid confusion.
In components based in SOY it causes confusion in many people that have used React already. I've seen that in candidates in Brazil's offices and Liferay employees that started learning MetalJS. It also makes easier to document and learning.