React render props

Render prop” we can share code between React components using a prop whose value is a function.

<Mycomponent render={(isAdmin)=> isAdmin ? 'login' : 'logout'}/>
{this.props.render}