react-native-popup-menu
Advanced tools
Comparing version 0.15.7 to 0.15.8
{ | ||
"name": "react-native-popup-menu", | ||
"version": "0.15.7", | ||
"version": "0.15.8", | ||
"description": "extensible popup/context menu for react native", | ||
@@ -59,3 +59,3 @@ "main": "build/rnpm.js", | ||
"chai": "^3.5.0", | ||
"eslint": "^3.19.0", | ||
"eslint": "^4.18.2", | ||
"eslint-plugin-react": "^7.0.0", | ||
@@ -62,0 +62,0 @@ "jasmine-reporters": "^2.1.1", |
@@ -80,2 +80,7 @@ import React from 'react'; | ||
/** checks if component is class component */ | ||
export function isClassComponent(component) { | ||
return component.prototype && !!component.prototype.render; | ||
} | ||
/** | ||
@@ -82,0 +87,0 @@ * Higher order component to deprecate usage of component. |
@@ -8,3 +8,3 @@ import React, { Component, createContext } from 'react'; | ||
import MenuPlaceholder from './MenuPlaceholder'; | ||
import { measure } from './helpers'; | ||
import { measure, isClassComponent } from './helpers'; | ||
import { debug } from './logger.js'; | ||
@@ -18,4 +18,2 @@ import MenuOutside from './renderers/MenuOutside'; | ||
const isFunctional = Component => !Component.prototype.render; | ||
if (!React.forwardRef) { | ||
@@ -312,3 +310,3 @@ throw new Error('This version of popup-menu requires RN 0.55+. Check our compatibility table.') | ||
const optionsType = isOutside ? MenuOutside : renderer; | ||
if (!isFunctional(optionsType)) { | ||
if (isClassComponent(optionsType)) { | ||
props.ref = this.onOptionsRef; | ||
@@ -315,0 +313,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4410
442111