score:1

i'm unable to reproduce this – works just fine in this minimal example derived from your code.

class myclass extends react.purecomponent {
    handlesubmit = () => {
        alert('submitted!');
    };

    render() {
        return (
            <form onsubmit={this.handlesubmit}>
                <button type='submit'>submit</button>
            </form>
        );
    }
}

reactdom.render(<myclass />, document.getelementbyid("root"));
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.0/umd/react-dom.production.min.js"></script>
<div id="root" />


Related Query

More Query from same tag