react-yue icon indicating copy to clipboard operation
react-yue copied to clipboard

Match react native API

Open dariocravero opened this issue 6 years ago • 4 comments

Hi,

Would you be interested in a PR matching react native's API where possible?

Off the top of my head it would be:

  • container -> View
  • scroll -> ScrollView
  • label -> Text
  • entry/textedit -> TextInput

with certain props remapped, eg:

<label text="hey" />

would be:

<text>hey</text>

Is that aligned with where you want to take this library?

Thanks! Darío

dariocravero avatar Jun 15 '18 22:06 dariocravero

I've been chatting with @oyyd about this and have started some work to make react-yue more close to react-native, see #4. He seems on board with the idea and I will be continuing to submit PRs to help get it closer to that point. The question regarding whether or not to rename the element names to match react native has some pros and cons. Pros being the ease with which someone coming from react native could jump into react-yue. The cons being that if someone needed to look at yue to better understand how one of those UI classes works, it's an extra step of figuring out which ui component maps back to yue. The other thing that would need to happen would be for react-yue to implement components that wrap the underlying elements so you can get <View /> instead of <view />. All doable we just need to determine if this is something we want to do.

shichongrui avatar Jun 16 '18 02:06 shichongrui

Like what @shichongrui said, react-yue is a renderer of yue. And matching the API of RN would make it confusing for those from yue. It would also cost us a lot of time to maintain the code.

We still need to learn a lot from yue and other tools of it in order to complete an app. They are unavoidable. So that, personally, I would like to keep the names of these components up with yue.

oyyd avatar Jun 16 '18 05:06 oyyd

I see your point @oyyd. Since yue is an evolution of electron and already depends on yoga for layout, I wonder, would it be desirable to have these changes (inlcuding what @shichongrui implemented on #4 which is great btw! :D) upstream instead @zcbenz?

dariocravero avatar Jun 16 '18 10:06 dariocravero

Currently, I would like the merge #4. I'm not familiar with react native and I think this needs more discussion and investigation. It would be better if we could come out with a detailed plan.

oyyd avatar Jun 23 '18 04:06 oyyd