I don't understand how this can work in javascript
renderMarkButton(type, icon) {
it looks like an arrow function, but without the arrows. Here's the context:
class HoverMenu extends React.Component {
renderMarkButton(type, icon) {
const { editor } = this.props
return (
<div className="editorButton"
onMouseDown={event => this.onClickMark(event, type)}>
<FontAwesomeIcon color="#666" active={isActive}
className="editorButton" icon={icon} />
</div>
)
}
render() {
return (
<div>
{this.renderMarkButton('bold', {...faBold})}
</div>
)
}
}
I'm also confused by the
const { editor } = this.props
which comes from Slate, I believe. I would have expected this.props to be {type,icon} in this case.