From 12c43455e77145fbc3f86636a6da96c0a69fd196 Mon Sep 17 00:00:00 2001 From: Dustin Schau Date: Fri, 28 Sep 2018 18:04:02 -0500 Subject: [PATCH] chore: add prop-types validation to code example --- src/components/CodeExample/CodeExample.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/CodeExample/CodeExample.js b/src/components/CodeExample/CodeExample.js index 24c1e1f8..05968a9f 100644 --- a/src/components/CodeExample/CodeExample.js +++ b/src/components/CodeExample/CodeExample.js @@ -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;