From aa66819f45f62f222a0291571fd83fc4add33a04 Mon Sep 17 00:00:00 2001 From: Clay Diffrient Date: Sat, 23 Apr 2016 13:07:39 -0600 Subject: [PATCH] [fixed] Removes unneeded sanitizeProps function (#169) fixes #165 The sanitize props function seems to be unneeded and there is no concrete explanation for why it is there. This removes it to prevent problems caused by calling it. --- examples/basic/app.js | 54 +---------------------------------------- lib/components/Modal.js | 5 ---- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/examples/basic/app.js b/examples/basic/app.js index 00b5ad47..648296a9 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -6,46 +6,16 @@ var appElement = document.getElementById('example'); Modal.setAppElement('#example'); -Modal.defaultStyles = { - overlay : { - position : 'fixed', - top : 0, - left : 0, - right : 0, - bottom : 0, - backgroundColor : 'rebeccapurple' - }, - content : { - position : 'absolute', - top : '40px', - left : '40px', - right : '40px', - bottom : '40px', - border : '1px solid #ccc', - background : '#fff', - overflow : 'auto', - WebkitOverflowScrolling : 'touch', - borderRadius : '4px', - outline : 'none', - padding : '20px' - - } -} - var App = React.createClass({ getInitialState: function() { - return { modalIsOpen: false, modalIsOpen2: false }; + return { modalIsOpen: false }; }, openModal: function() { this.setState({modalIsOpen: true}); }, - openModal2: function() { - this.setState({modalIsOpen2: true}); - }, - closeModal: function() { this.setState({modalIsOpen: false}); }, @@ -69,7 +39,6 @@ var App = React.createClass({ return (
- hi - -

Hello

- -
I am a modal
-
- - - - - -
- - - - -
-
); } diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 5f409ff4..6fcc4ad5 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -55,7 +55,6 @@ var Modal = React.createClass({ }, componentWillReceiveProps: function(newProps) { - sanitizeProps(newProps); this.renderPortal(newProps); }, @@ -110,7 +109,3 @@ Modal.defaultStyles = { } module.exports = Modal - -function sanitizeProps(props) { - delete props.ref; -}