Skip to content

Commit

Permalink
Use Object.prototype.hasOwnProperty. Resolves #300.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Oct 16, 2020
1 parent dab3e22 commit a4d0691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
@@ -1,8 +1,8 @@
import * as React from "react";
import { findDOMNode } from "react-dom";

const contextEnabled = React.hasOwnProperty("createContext");
const hooksEnabled = React.hasOwnProperty("useMemo") && React.hasOwnProperty("useCallback");
const contextEnabled = Object.prototype.hasOwnProperty.call(React, "createContext");
const hooksEnabled = Object.prototype.hasOwnProperty.call(React, "useMemo") && Object.prototype.hasOwnProperty.call(React, "useCallback");

export interface IPrintContextProps {
handlePrint: () => void,
Expand Down

0 comments on commit a4d0691

Please sign in to comment.