0.3.0 • Published 5 years ago

@sbovyrin/v-creator v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

v-creator.js

version npm bundle size downloads license

Change log

Create a view in functional way without using jsx.

! The library is under development

API

cv

cv(tag|ReactComponent [, {props} ])(children)
  • Return a React element
  • tag must be a string
  • ReactComponent must be a valid React element
  • props are optional
  • children can be array of React elements or raw js data structures
  • ! children will wrap in React.Fragment if passed as array and the array contains at least one valid React element.

Create a react element

VCreator.cv('h1')('Hello, World!'); 

Create a react element and pass prop

VCreator.cv('h1', {class: 'heading'})('Hello, World!');

Create a react element with multiple react elements within

VCreator.cv('div')([
  VCreator.cv("h1")("Children 1"),
  VCreator.cv("h2")("Children 2"),
  // ...
])

Create a react element with multple raw js elements within

VCreator.cv('div')([
  "children 1",
  "children 2",
  // ...
])

Using

CDN

<script src="https://unpkg.com/@sbovyrin/v-creator/umd/v-creator.min.js"></script> 

CommonJS module

const VCreator = require('@sbovyrin/v-creator')

ES module

import VCreator from '@sbovyrin/v-creator'
0.3.0

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago