Explore Library
Code QuizBeginner

Button onPress Prop

Learn to pass a function reference, not the result of calling it, to onPress.

Codejavascript
import React from 'react';
import { Button, Alert } from 'react-native';

export default function Submit() {
  return (
    <Button title="Go" onPress={Alert.alert('Hi')} />
  );
}

What is the bug in this code?