how to provide a fallback for an html element in React?

In case that "type" should not set we add the or operator , the alternative is 'button' . So if props.type is undefined this 'button' value will be used as a fallback type for the built in button.
import React from 'react';
import classes from './Button.module.css';
const Button = (props) => {
return (
<button className={classes.button} type={props.type || 'button' } >
{props.children}
</button>
);
}
export default Button;




