Skip to content

Instantly share code, notes, and snippets.

@pahund
Last active October 14, 2018 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pahund/1b9974edae354b7509be672ad4c4f7a7 to your computer and use it in GitHub Desktop.
Save pahund/1b9974edae354b7509be672ad4c4f7a7 to your computer and use it in GitHub Desktop.
Connected About Page Component, Dispatching an Action to the Hacker News Brick Component
import React from 'react';
import { connect } from 'react-redux';
import { HackerNews, loadTopStoriesAction } from '@modular-toolkit/demo-module';
const AboutPage = ({ dispatch }) => (
<main>
<header>
<h1>About Our Company</h1>
</header>
<p>We are very awesome!</p>
<HackerNews />
<button onClick={() => dispatch(loadTopStoriesAction())}>update</button>
</main>
);
export default connect()(AboutPage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment