Skip to content

Commit

Permalink
Merge pull request #301 from joeldenning/issue-300
Browse files Browse the repository at this point in the history
Use Object.prototype.hasOwnProperty. Resolves #300.
  • Loading branch information
MatthewHerbst authored Oct 17, 2020
2 parents dab3e22 + a4d0691 commit b41f23b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -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 b41f23b

Please sign in to comment.