Skip to content

Instantly share code, notes, and snippets.

@joe-crick
Last active March 26, 2018 12:38
Show Gist options
  • Save joe-crick/289028ead9f44ea3b3138fad096d1302 to your computer and use it in GitHub Desktop.
Save joe-crick/289028ead9f44ea3b3138fad096d1302 to your computer and use it in GitHub Desktop.
import React from 'react';
import * as actions from './actions';
import connect from "reduxigen/connect";

export const Car = ({make, model, year, editCar}) => 
 <div>
  <dl>
   <dt>Name</dt>
   <dd>{make}</dd>
   <dt>Model</dt>
   <dd>{model}</dd>
   <dt>Year</dt>
   <dd>{year}</dd>
  </dl>
  <button onClick={editCar}>Edit Car</button>
 </div>

// List all props to map in an array.
// Pass actions in as an object containing all actions.
// Reduxigen will map everything for you.
export default connect(['make', 'model', 'year'], actions)(Test);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment