const TextState = atom({key: 'Text', default: ''}); const Content: React.FC = () => { const [text, setText] = useState<string>(''); const setGlobalText = useSetRecoilState(TextState); useEffect(() => { setGlobalText(text); }, [text]) return ( <TextInput value={text} onChange={(event) => { const text = event.nativeEvent.text; setText(text) }} style={styles.sectionContainer} /> ) }