This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function App(props: Props) { | |
const [clipboardContents, setClipboardContents] = useClipboard(); | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>Clipboard contents: {clipboardContents}</Text> | |
<TextInput | |
style={styles.input} | |
onEndEditing={({nativeEvent: {text}}) => setClipboardContents(text)} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import React, {useState, useEffect} from 'react'; | |
import {NativeModules} from 'react-native'; | |
export default function useClipboard() { | |
const [contents, setContents] = useState(''); | |
useEffect(() => { | |
getClipboardContents(); | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import React, {useState, useEffect} from 'react'; | |
import {NativeModules} from 'react-native'; | |
export default function useClipboard() { | |
const [contents, setContents] = useState(''); | |
const setClipboardContents = (content) => { | |
NativeModules.Clipboard.setString(content); | |
setContents(content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import React from 'react'; | |
import {NativeModules} from 'react-native'; | |
export default function useClipboard() { | |
const contents = NativeModules.Clipboard.getString(); | |
const setClipboardContents = (content) => { | |
NativeModules.Clipboard.setString(content) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import React from 'react'; | |
export default function useClipboard() { | |
const contents = ''; | |
const setClipboardContents = (content) => { | |
}; | |
return [contents, setClipboardContents]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function App(props: Props) { | |
const [inputValue, setInputValue] = useState(''); | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>Clipboard contents: {''}</Text> | |
<TextInput | |
style={styles.input} | |
onChangeText={setInputValue} | |
onEndEditing={() => {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function App(props: Props) { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>Clipboard contents: {''}</Text> | |
<TextInput | |
style={styles.input} | |
onEndEditing={() => {}} | |
/> | |
</View> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class App extends Component<Props> { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>Welcome to React Native!</Text> | |
<Text style={styles.instructions}>To get started, edit App.js</Text> | |
<Text style={styles.instructions}>{instructions}</Text> | |
</View> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ComponentWithSavePost = graphql(savePostMutation, { | |
props: ({ mutate }) => ({ | |
savePost: (title, body) => mutate({ variables: { title, body } }), | |
}), | |
})(Component); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ComponentWithSaveCommentAndPostMutation = graphql(savePostMutation, { name : 'savePost' })( | |
graphql(saveCommentMutation, { name : 'saveComment' })(Component) | |
); |
NewerOlder