Skip to content

Instantly share code, notes, and snippets.

@RussMax783
RussMax783 / basecomponent-expansion.md
Last active August 18, 2017 21:52
basecomponent-expansion.md

I want to create a way that is easy to define the layout of components in the markup so that it will work on Web and React Native. Even if we don't go down the React Native route there is still so much to learn from how they structured their APIs and how they implemented certain aspects of how you interact with the DOM. I also think it would be super cool for Jane to have an open source project that works on React and React Native that is based on our base components. Utilizing styled components and themes we can do some really cool things. We can do a lot of what Leland Richardson talked about and create our components in such a way that they are easily shareable between web and native devices. To accomplish this with what we have currently built in Jane components, we need a couple more things, and i want to get your feed back on these components API/prop types.

Space

The space component is used to add gutter in-between items. it only takes and x, y, top, bottom, left, and right. The current gutter pr

Component Driven Design

  1. Pros/Cons with creating large components
  2. Pros/Cons for develping components in context
  3. What a componenet should consist of
  4. Recompose when you can: why shoot for pure instead of stateful
  • look at agreement with-state hoc
  1. React Storybook
  2. How do you test changes to components that is actually useful?
  3. Jest Snapshots

#Layout Component:

Internal Layout Styles:

Internal styles are styles that are applied to a component to style all its inner (immediate) children from border inward. The goal of this is to keep components as dynamic as possible by only defining what itself should always look like. We don't worry about where it is on the page or how is should look along side other components.

Internal layout styles include:

  • alignContent
@RussMax783
RussMax783 / actions.js
Created April 20, 2016 17:12
Setting up a socket connection in React/native app. put the socket instance in the store and make sure there is only one socket. Then set up your socket listeners and actions to dispatch when events come through
import connectSocket from './socketConfig';
export const INITIALIZE_SOCKET = 'INITIALIZE_SOCKET';
export const SOCKET_CONNECTED = 'SOCKET_CONNECTED';
export const SOCKET_DISCONNECTED = 'SOCKET_DISCONNECTED';
export const UPDATE_NETWORK_STATUS = 'UPDATE_NETWORK_STATUS';
export const SIGNED_OUT = 'SIGNED_OUT';
function socketInitialized(socket) {