mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
chore: add prop-types validation to code example
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import React, {Component} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import {colors, media} from 'theme';
|
||||
import CodeEditor from '../CodeEditor/CodeEditor';
|
||||
|
||||
@@ -57,4 +59,10 @@ class CodeExample extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
CodeExample.propTypes = {
|
||||
children: PropTypes.node,
|
||||
code: PropTypes.string.isRequired,
|
||||
loaded: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default CodeExample;
|
||||
|
||||
Reference in New Issue
Block a user