Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match react native API #3

Open
dariocravero opened this issue Jun 15, 2018 · 4 comments
Open

Match react native API #3

dariocravero opened this issue Jun 15, 2018 · 4 comments
Labels

Comments

@dariocravero
Copy link
Contributor

dariocravero commented Jun 15, 2018

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

@shichongrui
Copy link

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.

@oyyd
Copy link
Owner

oyyd commented Jun 16, 2018

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 oyyd added the discuss label Jun 16, 2018
@dariocravero
Copy link
Contributor Author

dariocravero commented Jun 16, 2018

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?

@oyyd
Copy link
Owner

oyyd commented Jun 23, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants