salsita / prism

React / Redux action composition made simple http://salsita.github.io/prism/
496 stars 24 forks source link

Composition Docs - typos + missing prop #18

Closed elado closed 8 years ago

elado commented 8 years ago

https://github.com/salsita/redux-elm/blob/master/docs/composition/README.md

1.

// invalid code
const ParentView = ({ model }) => ({
  <ChildView model={model.childViewModel} />
});

// correct
const ParentView = ({ model }) => (
  <ChildView model={model.childViewModel} />
);

2.

const ParentView = ({ model }) => ({
  <ChildView model={model.childViewModel} />
});

const ChildView = ({ model, onTextFieldChanged }) => ({
  <input type="text" onChange={onTextFieldChanged} value={model.value} />
});

Then where does the ChildView get its onTextFieldChanged?

tomkis commented 8 years ago

Thanks for pointing this out. Actually, you are not the only one raising this issue.