mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
24 lines
531 B
TypeScript
24 lines
531 B
TypeScript
import { Component } from 'react';
|
|
import logo from './logo.svg';
|
|
import './App.css';
|
|
import demo from './views/demo.liquid?raw';
|
|
import { engine } from './engine';
|
|
|
|
const template = engine.parse(demo)
|
|
|
|
export class App extends Component {
|
|
state = { html: '' }
|
|
|
|
async componentDidMount() {
|
|
const html = await engine.render(template, {name: 'liquid', logo })
|
|
this.setState({ html })
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div className="App" dangerouslySetInnerHTML={{__html: this.state.html}}>
|
|
</div>
|
|
)
|
|
}
|
|
}
|