In case of the else case you pass in a boolean, whereby the true case gets a string. What you can do is to set it to undefined.