Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/klzns/declarative-dom
Mini experimental library to declarative build UIs
https://github.com/klzns/declarative-dom
Last synced: 26 days ago
JSON representation
Mini experimental library to declarative build UIs
- Host: GitHub
- URL: https://github.com/klzns/declarative-dom
- Owner: klzns
- Created: 2017-03-10T13:26:20.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T14:08:01.000Z (almost 8 years ago)
- Last Synced: 2024-11-12T15:43:47.802Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Declarative DOM
> Is mini experimental library to declarative build UIs
## How
```js
import d from 'declarative-dom'function MyComponent({ text }) {
const handleClick = () => { console.log(text) }return d(
'div', { id: 'my-component', onClick: handleClick },
Message({ text })
)
}function Message({ text }) {
return d(
'span', { style: 'color: red;' },
text
)
}document.body.appendChild(MyComponent({ text: 'Hello World!' }))
```