File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,10 +2,27 @@ import React from "react";
22
33import styles from "./styles.module.css" ;
44
5+ function errorMessage ( propertyName ) {
6+ const what = "" ;
7+ const where = location . pathname ;
8+ const message = `Missing property (${ propertyName } ) for (Function) imported from here: ${ where } . Please add one!\n\n` ;
9+ return message ;
10+ }
11+
512class Function extends React . Component {
613 render ( ) {
714 const since = this . props . since ;
815 const children = this . props . children ;
16+
17+ const isRunningInDevelopmentMode = process . env . NODE_ENV !== "production" ;
18+ if ( isRunningInDevelopmentMode ) {
19+ // Doesn't look like more context can easily be obtained, so let's leave it at that...
20+ const where = location ;
21+ const what = `Missing property (since) for (Function) imported from ${ where } ` ;
22+ const message = `${ what } ` ;
23+ if ( ! since ) throw new Error ( message ) ;
24+ }
25+
926 const sinceBlock = ( since && (
1027 < >
1128 < span className = { styles . sinceBlock } > Available since: { since } </ span >
You can’t perform that action at this time.
0 commit comments