Skip to content

Commit

Permalink
Add note in View.js render method that wrapper component is not used.
Browse files Browse the repository at this point in the history
Summary: Got bitten lately by View.js returning different component based on `__DEV__`

Adding a warning in the render method that should make it cleaner in the future that this method is not actually being used in prod mode.
Closes facebook#4322

Reviewed By: svcscm

Differential Revision: D2691880

Pulled By: vjeux

fb-gh-sync-id: 119672740969a857ab6288b7914d52e8d40a1d95
  • Loading branch information
kmagiera authored and facebook-github-bot-4 committed Nov 24, 2015
1 parent 510f001 commit 469a652
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libraries/Components/View/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ var View = React.createClass({
},

render: function() {
// WARNING: This method will not be used in production mode as in that mode we
// replace wrapper component View with generated native wrapper RCTView. Avoid
// adding functionality this component that you'd want to be available in both
// dev and prod modes.
return <RCTView {...this.props} />;
},
});
Expand Down

0 comments on commit 469a652

Please sign in to comment.