Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 788 Bytes

gettting-started.md

File metadata and controls

37 lines (22 loc) · 788 Bytes

Getting Started

intro

Function Components

hooks are a proposed change to React

Using React 16.6, needs useHooks as a "polyfill"

Models

features will register their models with any app they are mounted in. models registered after actions have arrived will receive a replay.

Providers

features create a new scope in the context. they can provide an object to add to or overwrite any providers from enclosing scopes.

Mothership starts with routing components already provided.

Declarative Routing

explain react-router

components are the "source" of events.

function Hello({ done }) {
  const { Redirect } = useProvided()

  if (done) {
    return <Redirect view="Goodbye" />
  }

  return 'Hello'
}