https://reactnativedev.ru/rn/intro-react/ #16
Replies: 1 comment
|
Очень круто. import React, {useState} from 'react';
import {Button, Text, View} from 'react-native';
const Event = () => {
const [status, setStatus] = useState(false);
const [key, setKey] = useState(false);
return (
<View>
<Text>
Вы нашли таинственный сундук..
Откроете ли вы его?
</Text>
<Button
onPress={() => {
setStatus(true)
}}
disabled={!key && !status}
title={key ? 'Открыть!': 'Заберите ключ.'}
/>
<Button
onPress={() => {
setKey(true)
}}
disabled={key}
title={!key ? 'Получить ключ': 'Вы забрали ключ!'}
/>
</View>
);
}
export default function Form() {
return(<View><Event/></View>)
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
https://reactnativedev.ru/rn/intro-react/
Справочник React Native с примерами кода
https://reactnativedev.ru/rn/intro-react/
All reactions