Skip to content

Commit

Permalink
Merge pull request #250 from kadirahq/context-argument
Browse files Browse the repository at this point in the history
Pass selected kind and story as args
  • Loading branch information
Muhammed Thanish committed Jun 14, 2016
2 parents 2772b53 + 18d5aab commit 98b28b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ function renderMain(data, storyStore) {
_reactDom2.default.unmountComponentAtNode(rootEl);
}

return _reactDom2.default.render(story(), rootEl);
var context = {
kind: selectedKind,
story: selectedStory
};

return _reactDom2.default.render(story(context), rootEl);
}

function renderPreview(_ref) {
Expand Down
7 changes: 6 additions & 1 deletion src/client/preview/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export function renderMain(data, storyStore) {
ReactDOM.unmountComponentAtNode(rootEl);
}

return ReactDOM.render(story(), rootEl);
const context = {
kind: selectedKind,
story: selectedStory,
};

return ReactDOM.render(story(context), rootEl);
}

export default function renderPreview({ reduxStore, storyStore }) {
Expand Down

0 comments on commit 98b28b0

Please sign in to comment.