Skip to content

dustinspecker/dscript-react

Repository files navigation

dscript-react

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

PRs Welcome Commitizen friendly semantic-release

dscript with React setup done for you

Check out dscript for documentation on more advanced usage.

Install

For usage with React v15.0:

npm install --save dscript-react

Note: React v0.14 users should install via npm install --save dscript-react@1.0.0

Usage

import creator, {div, li, ul} from 'dscript-react'

import customComponent from './custom-component'

const customComponentCreator = creator(customComponent)

const handleClick = () => alert('hi')

export default props =>
  div('.list-container', {onClick: handleClick}, [
    customComponentCreator({total: props.total}),
    ul(
      props.items.map(item =>
        li([item.name])
      )
    )
  ])

LICENSE

MIT © Dustin Specker