score:5

Accepted answer

<pencilfill classname="mr-10" size={ 10 }/> + 'view'

the first part of this is an object, and the second part is a string, so when you concatenate them together you get [object object]view. what you probably meant to do was a fragment, as in:

<react.fragment>
  <pencilfill classname="mr-10" size={ 10 }/>
  view
</react.fragment>

or using the shorthand notation:

<>
  <pencilfill classname="mr-10" size={ 10 }/>
  view
</>

score:1

don't use + operator as it concats jsx with string.
try ternary only at the place that you want to change like this.

<pencilfill classname="mr-10" size={ 10 }/> 
{quote.is_archived ? 'view' : 'edit'}

Related Query

More Query from same tag