mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* beautify code block with google-code-prettify * prettyPrint when componentDidMount * css style for code block * skip rule 'no-unresolved' for eslint * conflict with webpack resolve path * refactor all code block in example folder with component <Code /> * refactor scss folder structure * specify the responsibility for each stylesheet with file name * load local color themes, tomorrow, for google code prettify * re-select demo color and save into variable * unify the color system for storybook
27 lines
636 B
JavaScript
27 lines
636 B
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
export default class extends Component {
|
|
static propTypes = {
|
|
children: PropTypes.string
|
|
}
|
|
static defaultProps = {
|
|
children: ''
|
|
}
|
|
componentDidMount() {
|
|
// code-prettify
|
|
// run the PR.prettyPrint() function once your page has finished loading
|
|
if (typeof (PR) !== 'undefined') PR.prettyPrint(); // eslint-disable-line no-undef
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div className="highlight-text-html-basic">
|
|
<pre className="prettyprint lang-js">
|
|
{ this.props.children }
|
|
</pre>
|
|
</div>
|
|
);
|
|
}
|
|
}
|