In the following code I need set text for a <li> html element to bold when variable isActive is true otherwise text should be rendered in plain.
Currently I receive the following error:
Objects are not valid as a React child (found: object with keys {title}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of
Navigation
How to fix it?
import React from 'react'
const idSuffix = 'navigation__'
const Navigation = ({ onClick, id, title, tooltip, isActive }) => (
<li id={`${idSuffix}${id}`} onClick={onClick} alt={tooltip} data-active={isActive}>
{isActive ? <b>{title}</b> : {title} }
</li>
)
export default Navigation
${idSuffix}${id}} onClick={onClick} alt={tooltip} data-active={isActive}> {title} </li>{isActive ? <b>{title}</b> : title}, better use className for that