mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-11 00:56:25 +02:00
Console: Make it pure
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import { h, Component } from 'preact';
|
import { h, Component } from 'preact';
|
||||||
import { Inspector, chromeDark } from 'react-inspector';
|
import { Inspector, chromeDark } from 'react-inspector';
|
||||||
import { Trans } from '@lingui/macro';
|
import { Trans } from '@lingui/macro';
|
||||||
|
import { PureComponent } from 'preact-compat';
|
||||||
|
|
||||||
class LogRow extends Component {
|
class LogRow extends Component {
|
||||||
shouldComponentUpdate() {
|
shouldComponentUpdate() {
|
||||||
@ -22,7 +23,7 @@ class LogRow extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Console extends Component {
|
export class Console extends PureComponent {
|
||||||
componentWillUpdate(nextProps) {
|
componentWillUpdate(nextProps) {
|
||||||
if (nextProps.logs != this.props.logs) {
|
if (nextProps.logs != this.props.logs) {
|
||||||
// Scroll down after new log dom is inserted
|
// Scroll down after new log dom is inserted
|
||||||
|
Reference in New Issue
Block a user