lelandrichardson / react-primitives

Primitive React Interfaces Across Targets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Looking for a basic example

thebetterjort opened this issue · comments

Anybody have a basic example? The example/ folder is an example, but its much too difficult for me to understand all the working parts.
I'm wondering if I can use create-react-app & create-reactnative-app w/ styled-components and primitives to create a universal component system. eg) Rendering a H1 on android, web, ios would be very helpful.
Thanks.

with styled components:

import styled from 'styled-components/primitives';

export const H1 = styled.Text`
  font-size: 48px;
`;

In terms of directory structure and business logic.

app/
--/ios
--/android
--/web

Are people writing components 3 different times for 3 different files (platforms)? Or is there sometype of check that can be made to ensure the proper codes gets run?

Watch this in order to clarify yourself a little bit more. It was suggested by @lelandrichardson.