File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ export const Button = ( { children, onClick} ) => {
4+ return < button onClick = { onClick } > { children } </ button > ;
5+ } ;
Original file line number Diff line number Diff line change 66} from 'react-native-react-bridge/lib/web' ;
77import './example.css' ;
88import png from './Octocat.png' ;
9+ import { Button } from './button' ;
910
1011const style = {
1112 width : '100vw' ,
@@ -16,7 +17,7 @@ const style = {
1617
1718const Root = ( ) => {
1819 const [ data , setData ] = useState ( 'This is Web' ) ;
19- useSubscribe ( ( message ) => {
20+ useSubscribe ( message => {
2021 if ( message . type === 'hello' ) {
2122 setData ( message . data ) ;
2223 }
@@ -26,11 +27,11 @@ const Root = () => {
2627 < div >
2728 < img src = { png } width = { 100 } height = { 'auto' } />
2829 </ div >
29- < textarea value = { data } onChange = { ( e ) => setData ( e . target . value ) } />
30+ < textarea value = { data } onChange = { e => setData ( e . target . value ) } />
3031 < div >
31- < button onClick = { ( ) => emit ( { type : 'hi' , data : data } ) } >
32+ < Button onClick = { ( ) => emit ( { type : 'hi' , data : data } ) } >
3233 send to React Native
33- </ button >
34+ </ Button >
3435 </ div >
3536 </ div >
3637 ) ;
You can’t perform that action at this time.
0 commit comments