Private
Public Access
1
0
Files

8 lines
318 B
JavaScript

import * as React from 'react';
export function assertIsDefinedRef(refObject, msg = `assertIsDefinedRef: reference not properly defined ${refObject}`) {
// eslint-disable-next-line eqeqeq
if (refObject.current == undefined && process.env.NODE_ENV === 'development') {
throw new TypeError(msg);
}
}