getInitialState无法在Movies Tutorial中使用

时间:2016-01-16 00:01:56

标签: react-native

尝试使用电影应用关注React Native教程。 使用iOS或Android一切正常,直到我们尝试将状态引入组件。 本教程不使用ES6类,但Hello World应用程序确实如此,这就是令人困惑的地方。

教程说要添加getInitialState: function() { return { movies: null, }; }, 因为使用ES6类而假设中断,但是使用构造函数似乎也没有用,所以我想知道正确的方法是什么?

教程

constructor(props) {
  super(props);
  this.state = {
    movies: null,
  };
},

ES6等效?

 Sub ERCACMPCleanup()

'Cleans ERCA_CMP Worksheet and creates extra records for comma delimited

  Dim X As Long, LastRow As Long, A As Range, Table As Range, Data() As String
  Const Delimiter As String = ", "
  Const DelimitedColumn As String = "A"
  Const TableColumns As String = "A:O"
  Const StartRow As Long = 2
  Application.ScreenUpdating = False
  ActiveWorkbook.Worksheets("ERCA_CMP").Visible = True
  ActiveWorkbook.Worksheets("ERCA_CMP").Activate
  LastRow = Columns(TableColumns).Find(What:="*", SearchOrder:=xlRows, _
            SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row
  For X = LastRow To StartRow Step -1
    Data = Split(Cells(X, DelimitedColumn), Delimiter)
    If UBound(Data) > 0 Then
      Intersect(Rows(X + 1), Columns(TableColumns)).Resize(UBound(Data)).Insert xlShiftDown
    End If
    If Len(Cells(X, DelimitedColumn)) Then
      Cells(X, DelimitedColumn).Resize(UBound(Data) + 1) = WorksheetFunction.Transpose(Data)
    End If
  Next
  **LastRow = Cells(Rows.Count, DelimitedColumn).End(xlUp).Row
  On Error Resume Next
  Set Table = Intersect(Columns(TableColumns), Rows(StartRow).Resize(LastRow - StartRow + 1))

  If Err.Number = 0 Then
    Table.SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
    Columns(DelimitedColumn).SpecialCells(xlFormulas).Clear
    Table.Value = Table.Value
  End If
  On Error GoTo 0**
End Sub        

1 个答案:

答案 0 :(得分:2)

不要在类中的方法之后使用逗号(,)!

DEPRECATION WARNING: The assertion was not run because of an invalid css 
unexpected '#' after '[#<Nokogiri::CSS::Node:0x000000076e23f8 @type=:ELEMENT_NAME, 
@value=["div"]>]' (called from block in <class:UsersSignupTest> at   
/home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:14)

DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '<' after '.' (called from block in <class:UsersSignupTest> at 
/home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:15)