댓글 검색 목록

[Nodejs] Ink - 대화 형 명령 줄 앱에 반응합니다.

페이지 정보

작성자 운영자 작성일 19-03-07 12:06 조회 439 댓글 0

https://github.com/vadimdemedes/ink

demo.svg?sanitize=true 


import React, {Component} from 'react';
import {render, Color} from 'ink';

class Counter extends Component {
	constructor() {
		super();

		this.state = {
			i: 0
		};
	}

	render() {
		return (
			<Color green>
				{this.state.i} tests passed
			</Color>
		);
	}

	componentDidMount() {
		this.timer = setInterval(() => {
			this.setState({
				i: this.state.i + 1
			});
		}, 100);
	}

	componentWillUnmount() {
		clearInterval(this.timer);
	}
}

render(<Counter/>);



댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.