arch-dom

0.14.0 • Public • Published

arch-dom

A small utility for helping to write React components without JSX.

Features:

  • No need to pass null props when not required (just pass children) in 99% of cases.
  • Pass children as function arguments rather than an array.

Usage (LiveScript):

React = require 'react'
{ div, h1, span, img } = require 'arch-dom'

module.exports = class SomeComponent extends React.Component
  render: ->
    div do
      h1 "Welcome, user!"
      span "This is the home page."
      img do
        src: "http://some/image.png"
        alt: "A picture of a dolphin."

To wrap your own component with the DSL you can just pass it to arch-dom

dom = require 'arch-dom'
post = dom require '../components/post'

/arch-dom/

    Package Sidebar

    Install

    npm i arch-dom

    Weekly Downloads

    3

    Version

    0.14.0

    License

    ISC

    Last publish

    Collaborators

    • tabazevedo