How to replace space with   in a string (ReactJS) and render in HTML?

<div className="mt-2 font-sidebar capitalize"> {item.title} </div> item.title can be any string (from backend) for example “all products”, “most liked”, “featured items”, etc. I want a way to replace the space in item.title with &nbsp; so that when rendered in HTML it still has a space – This is for a specific use case. I would … Read more