import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Fullscreenable from '../src/'; export class DemoComponent extends Component { componentWillReceiveProps(nextProps) { if (this.props.isFullscreen !== nextProps.isFullscreen) { // Fullscreen status has changed. } } render() { const { isFullscreen, toggleFullscreen } = this.props; const buttonLabel = isFullscreen ? 'Exit Fullscreen' : 'Enter Fullscreen'; const toggleButton = ; return (
This component is enhanced with Fullscreenable.
{toggleButton}{JSON.stringify(this.props, null, ' ')}