-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] ReactJS

, 01 2017 . 23:11 +
, . , .

, - . , , ) , .

, , . Redux .

. , - jasmine. : , , -.

, .

1.

( , -) : - , - ( SPA, ...). ReactJS , - (, props). , , , : , ( , ). , ReactJS .

, , , ( ) . , setState ; , setState ( - jasmine ), setState - . , .

2.

, , , . 1) increment component.getInstance(), 2) - . , - ( , ), , ( , , - ). , - increment ( , ), -, onClick - {increment} {() => if (this.state.count > 0) decrement();} .

, . ; , ( +) ( ), , . increment increment, increment , , ( ) - -; +, .

, . , ; , . ( ) , ; getInstance().onPlusButtonClick(). , event ( - ), . : , (event) => onTextChange(event.value) , , , , event .

, , , . , , , , , , , . , :)

3.

=) ? . ( CSS). , , jest ; , , DOM. . , .

, . , - . ( ). , , , ; , , . , : 1) , , , 2) ( , , , - , ).

. , , - , , - . , , .Net MVVM: ViewModel, view, view . ViewModel : , , . ViewModel , , , - , ViewModel , , ( ) , , , .

.1 , setState - , . - ViewModel, props, - X ViewModel, props setX f(x), viewModel.prop1 := x. , f(x) , - setState. , , state , , setState . - Redux.

. , . ViewModel ( ), - , , , . - gotoFirstPage(), , 1, , null ( ).
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/332090/

:  

: [1] []
 

:
: 

: ( )

:

  URL