From 3955236b0ff3e48891a55bcb01303a298f6a134b Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 6 Jul 2015 15:00:17 -0700 Subject: [PATCH] Update StaticContainer from static_upstream --- .../StaticContainer/StaticContainer.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js b/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js index e37d0aaa4..9165576d7 100644 --- a/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js +++ b/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<2a163cdb088fb963f941e627fd89ce11>> * * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * !! This file is a check-in of a static_upstream project! !! @@ -12,8 +12,11 @@ * !! static_upstream. !! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * + * Copyright 2004-present Facebook. All Rights Reserved. + * * @providesModule StaticContainer.react - * @jsx React.DOM + * @typechecks + * @flow */ var React = require('React'); @@ -35,16 +38,17 @@ var onlyChild = require('onlyChild'); * Typically, you will not need to use this component and should opt for normal * React reconciliation. */ -var StaticContainer = React.createClass({ +class StaticContainer extends React.Component { - shouldComponentUpdate: function(nextProps) { - return nextProps.shouldUpdate; - }, - - render: function() { - return onlyChild(this.props.children); + shouldComponentUpdate(nextProps: Object): boolean { + return !!nextProps.shouldUpdate; } -}); + render() { + var child = this.props.children; + return (child === null || child === false) ? null : onlyChild(child); + } + +} module.exports = StaticContainer;