Skip to content

Instantly share code, notes, and snippets.

@kimniche
Created March 2, 2017 14:38
Show Gist options
  • Select an option

  • Save kimniche/fc5844c08efb389943e6a510280f4156 to your computer and use it in GitHub Desktop.

Select an option

Save kimniche/fc5844c08efb389943e6a510280f4156 to your computer and use it in GitHub Desktop.
import React from 'react'
import { withDependencies } from '../utils/env-utils'
import { isInBackpack } from '../utils/backpack-utils-utils'
const BackpackTester = ({ thing }, { _ }) => (
const isThingInBackpack = _.isInBackpack(thing)
return (
<div>
Is thing in backpack? { isThingInBackpack }
</div>
)
)
BackpackTester.propTypes = {
thing: React.PropTypes.object,
}
BackpackTester.contextTypes = {
_: React.PropTypes.object, // dependencies
}
export default withDependencies(BackpackTester, [isInBackpack])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment