0

this is a component where i want to implement this

export default function SingleBook () {    
     return (
     <div>
    // iam getting value in this where '<' is to be replace by ' '
                    <ListItemText primary={SingleBook.avg_rating.value} />
                   </div>
)
             
} 
 

3 Answers 3

1

This might help

SingleBook.avg_rating.value.replaceAll("<"," ")
Sign up to request clarification or add additional context in comments.

Comments

0

Use 'st<ing'.replaceAll('<',' ');

Comments

0

The parts inside the curly braces in JSX is interpreted as normal JavaScript.

Therefore you can use all the ordinary JavaScript functions there, such as String.prototype.replace or String.prototype.replaceAll

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.