I was implementing a basic rating component in React and somehow i did this
const Rating = ( {text},{value}) => {
return (
<div className='rating'>
<span>
<i className={value>=1?'fas fa-star':value>=0.5?'fas fa-star-half-alt':'far fa-star'}></i>
</span>
</div>
)}
instead of this
const Rating = ( {text,value}) => {
return (
<div className='rating'>
<span>
<i className={value>=1?'fas fa-star':value>=0.5?'fas fa-star-half-alt':'far fa-star'}></i>
</span>
</div>
)}
Can anyone tell me why the value is not processed in the first part?
P.S. I am relatively new in the react/javascript field, so sorry if it's a very basic question.