How to render empty space in React and JavaScript?

Sometimes, we want to render empty space in React and JavaScript.

In this article, we’ll look at how to render empty space in React and JavaScript.

How to render empty space in React and JavaScript?

To render empty space in React and JavaScript, we can put the character code for spaces into the code.

For instance, we write:

import React from "react";

export default function App() {
  return <>foo{"u00a0u00a0"}bar</>;
}

to add "u00a0u00a0" to add 2 spaces between foo and bar.

Conclusion

To render empty space in React and JavaScript, we can put the character code for spaces into the code.