mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
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
This commit is contained in:
parent
e8b508144f
commit
db35324610
@ -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'
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user