I have web app that contains page with header. There are 3 buttons in header and I want to "attach" Confirm component to one of them, which means when I click that button Confirm component will be displayed. The code looks as following:
const renderButtons = (actions: Interfaces.DeclarationAction[]) =>
actions.map((action, i) => {
if (action.name === 4) {
<Confirm
name={modalName()}
content="Are you sure?"
onConfirm={checkingFinish}
/>
}
<ActionButton
key={i}
action={action}
onClickAction={props.onClickAction}
declaration={props.declaration}/>
});
As you can see, the renderButtons renders those 3 buttons, but there is an error. Please, take a look at the screen shot below:
How to get rid of the error?

returnstatement