我想隐藏注册并使用 的disable属性TouchableOpacity,但它似乎不起作用
const isInvalid =
passwordOne !== passwordTwo ||
passwordOne === "" ||
email === "" ||
username === "";
<TouchableOpacity style={styles.button} disabled={isInvalid}>
<Text style={styles.buttonText} onPress={this.handleSignUp}>
Sign up
</Text>
</TouchableOpacity>
Run Code Online (Sandbox Code Playgroud)
但注册按钮并未隐藏
我的代码:
import ....
const INITIAL_STATE = {
...
};
export default class Signup extends Component<{}> {
handleSignUp = () => {
...
};
render() {
const isInvalid =
passwordOne !== passwordTwo ||
passwordOne === "" ||
email === "" ||
username === "";
return ( …Run Code Online (Sandbox Code Playgroud)