@@ -76,42 +76,42 @@ object React {
7676 ): ReactClass = {
7777 NativeCreateClass .create(
7878 displayName = displayName,
79- render = js. ThisFunction .fromFunction1(( native : js.Dynamic ) => {
79+ renderDef = { ( native : js.Dynamic ) =>
8080 render(Self (native))
81- }) ,
82- getInitialState = js. ThisFunction .fromFunction1(( native : js.Dynamic ) => {
81+ },
82+ getInitialState = { ( native : js.Dynamic ) =>
8383 if (getInitialState != null ) {
8484 React .stateToNative(getInitialState(Self (native)))
8585 } else {
8686 React .stateToNative(())
8787 }
88- }) ,
89- componentDidMount = js. ThisFunction .fromFunction1(( native : js.Dynamic ) => {
88+ },
89+ componentDidMountDef = { ( native : js.Dynamic ) =>
9090 if (componentDidMount != null ) {
9191 componentDidMount(Self (native))
9292 }
93- }) ,
94- shouldComponentUpdate = js. ThisFunction .fromFunction3(( native : js.Dynamic , nextProps : js.Dynamic , nextState : js.Dynamic ) => {
93+ },
94+ shouldComponentUpdateDef = { ( native : js.Dynamic , nextProps : js.Dynamic , nextState : js.Dynamic ) =>
9595 if (shouldComponentUpdate != null ) {
9696 shouldComponentUpdate(Self (native), Props (nextProps), React .stateFromNative(nextState))
9797 }
9898 else true
99- }) ,
100- componentDidUpdate = js. ThisFunction .fromFunction3(( native : js.Dynamic , prevProps : js.Dynamic , prevState : js.Dynamic ) => {
99+ },
100+ componentDidUpdateDef = { ( native : js.Dynamic , prevProps : js.Dynamic , prevState : js.Dynamic ) =>
101101 if (componentDidUpdate != null ) {
102102 componentDidUpdate(Self (native), Props (prevProps), React .stateFromNative(prevState))
103103 }
104- }) ,
105- componentWillUnmount = js. ThisFunction .fromFunction1(( native : js.Dynamic ) => {
104+ },
105+ componentWillUnmountDef = { ( native : js.Dynamic ) =>
106106 if (componentWillUnmount != null ) {
107107 componentWillUnmount(Self (native))
108108 }
109- }) ,
110- componentDidCatch = {
109+ },
110+ componentDidCatchDef = {
111111 if (componentDidCatch != null ) {
112- js. ThisFunction .fromFunction3( (native : js.Dynamic , error : js.Object , info : js.Dynamic ) => {
112+ (native : js.Dynamic , error : js.Object , info : js.Dynamic ) => {
113113 componentDidCatch(Self (native), error, info)
114- })
114+ }
115115 }
116116 else null
117117 }
@@ -139,17 +139,5 @@ object NativeReact extends js.Object {
139139}
140140
141141@ js.native
142- @ JSImport (" ./io/github/shogowada/scalajs/reactjs/CreateClass.js" , JSImport .Namespace )
143- object NativeCreateClass extends js.Object {
144-
145- def create (
146- displayName : String ,
147- render : js.ThisFunction0 [js.Dynamic , ReactElement ],
148- getInitialState : js.ThisFunction0 [js.Dynamic , js.Dynamic ],
149- componentDidMount : js.ThisFunction0 [js.Dynamic , Unit ],
150- shouldComponentUpdate : js.ThisFunction2 [js.Dynamic , js.Dynamic , js.Dynamic , Boolean ],
151- componentDidUpdate : js.ThisFunction2 [js.Dynamic , js.Dynamic , js.Dynamic , Unit ],
152- componentWillUnmount : js.ThisFunction0 [js.Dynamic , Unit ],
153- componentDidCatch : js.ThisFunction2 [js.Dynamic , js.Object , js.Dynamic , Unit ]
154- ): ReactClass = js.native
155- }
142+ @ JSImport (" react" , " Component" )
143+ class ReactComponent (props : js.Dynamic ) extends js.Object
0 commit comments