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

Setup React Native mobile app #1

Closed
calebmer opened this issue Feb 28, 2019 · 8 comments
Closed

Setup React Native mobile app #1

calebmer opened this issue Feb 28, 2019 · 8 comments

Comments

@calebmer
Copy link
Owner

I’m pretty convinced that for this product to be successful we will need a React Native mobile app. Currently, the web app is Next.js with react-native-web because I want to maximize code sharing between native mobile and web.

We need to set up the React Native mobile app. Currently, I have some basic UI code in workspaces/web. Let’s try to get that into a React Native app. As we build more of the UI it should seamlessly work cross-platform. (Ideally)

I’d like to use Expo, but I want React Hooks more then I want Expo 😛

@Domthegrom
Copy link
Collaborator

Domthegrom commented Feb 28, 2019

React native will be getting Hooks eventually. Is this something that you may want to push back on that way we can use RN out of the box.

How would you plan to use react web components as React Native components?

I am a bit familiar with React Native to Web using https://github.com/necolas/react-native-web

But I haven't seen a transition from web components to native components.

@calebmer
Copy link
Owner Author

Since they use the same API the web components should just “work” in React Native. For example, take a look at:

export function ProfileSignature({
name,
image,
time,
children,
}: {
name: string;
image: string;
time: string;
children: ReactNode;
}) {
return (
<View style={styles.container}>
<ProfileImage image={image} />
<View style={styles.body}>
<View style={styles.header}>
<LabelText>{name}</LabelText>
<View style={styles.headerTime}>
<LiteText>{time}</LiteText>
</View>
</View>
{children}
</View>
</View>
);
}

It uses <View> instead of <div> which should mean we can use it in React Native no problem.

@baruchadi
Copy link
Collaborator

You can use View in Web React?

@Domthegrom
Copy link
Collaborator

To me that looks like a React-Native component that won't render in Web React. You imported View from react-native

@calebmer calebmer reopened this Feb 28, 2019
@calebmer
Copy link
Owner Author

calebmer commented Feb 28, 2019

@calebmer
Copy link
Owner Author

Looks like it renders to me @Domthegrom

image

@mdgozza
Copy link
Collaborator

mdgozza commented Mar 2, 2019

@Domthegrom This is why that works:
https://github.com/calebmer/connect/blob/master/web/next.config.js#L11

@calebmer
Copy link
Owner Author

I did this, but didn’t even touch Android yet #18

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

No branches or pull requests

4 participants