I have a ButtonActor.js
for Buttons:
import React from 'react';
import '../../css/index.css';
import '../../css/App.css';
import '../../css/bootstrap.min.css';
import '../../css/font-awesome.css';
import '../../css/floating-labels.css';
import Home from "../view/Home";
import { Route, BrowserRouter as Router } from 'react-router-dom'
class ButtonActor extends React.Component {
isPrimaryButton;
hLink;
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
console.log("clicked");
}
render() {
if(this.props.isPrimaryButton==="true")
{
return (
<div>
<button className="btn btn-lg btn-primary btn-block btn-animated" type="submit">
{this.props.name}
</button>
</div>
);
}
else
{
return (
<div>
<button className="btn btn-sm btn-secondary btn-block btn-animated" type="submit" onClick={this.handleClick}>
{this.props.name}
</button>
</div>
);
}
}
}
export default ButtonActor;
And the have this piece of code in Login.js :
<div className="row justify-content-start">
<form className="form-signin">
<ButtonActor name="Don't Have An Account?" isPrimaryButton="false">
</ButtonActor>
</form>
</div>
Whenever I click on the Button this page just reloads the current page with a ?
mark at the end.
How can I resolve this issue ?
As it reloads I can't even see if it is printing in the console or not.