Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Themes } from "hig-vanilla";
import "hig-vanilla/lib/hig.css";
import HIGPropTypes from "./HIGPropTypes";
class HIGAdapter extends Component {
static propTypes = {
children: PropTypes.func,
HIGConstructor: PropTypes.func.isRequired,
displayName: PropTypes.string.isRequired,
higInstance: HIGPropTypes.higInstance,
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static contextTypes = {
higParent: PropTypes.object,
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static childContextTypes = {
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static defaultProps = {
children: () => {},
higInstance: undefined
};
class HIGAdapter extends Component {
static propTypes = {
children: PropTypes.func,
HIGConstructor: PropTypes.func.isRequired,
displayName: PropTypes.string.isRequired,
higInstance: HIGPropTypes.higInstance,
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static contextTypes = {
higParent: PropTypes.object,
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static childContextTypes = {
higTheme: PropTypes.oneOf(Themes.AvailableThemes)
};
static defaultProps = {
children: () => {},
higInstance: undefined
};
constructor(props) {
super(props);
this.state = {
higInstance: props.higInstance || new props.HIGConstructor({}),
mounted: false
};
}
getChildContext() {