From db3532461058b36fffcdd5e82b7381f468c266a6 Mon Sep 17 00:00:00 2001 From: gregjacobson Date: Sat, 30 Jul 2016 16:59:05 -0700 Subject: [PATCH] Change getDefaultProps to static and remove warning Summary: When trying sample code from the _Working with Scenes_ area of this page I see a warning and the example did not appear to work as expected. To fix this I updated the code to static so others following along will not see a warning about using a static property to define defaultProps. Also included is a screen capture of the warning message. ![react-native-warning-defaultprops](https://cloud.githubusercontent.com/assets/1053650/17271580/9d0e85fc-564d-11e6-9c58-f73ef708aade.png) Closes https://github.com/facebook/react-native/pull/9108 Differential Revision: D3647366 fbshipit-source-id: 93b152756e6351614caf4ae1d5f45bac893fdf7b --- docs/UsingNavigators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UsingNavigators.md b/docs/UsingNavigators.md index 5aee3bb681..dd7eef7921 100644 --- a/docs/UsingNavigators.md +++ b/docs/UsingNavigators.md @@ -31,7 +31,7 @@ import React, { Component } from 'react'; import { View, Text } from 'react-native'; export default class MyScene extends Component { - getDefaultProps() { + static get defaultProps() { return { title: 'MyScene' };