score:311
See: JSX In Depth
Try:
Select Scenario:{'\u00A0'}
Or:
<div dangerouslySetInnerHTML={{__html: 'Select Scenario: '}} />
Or:
<div> </div>
Update
After seeing some of the comments, and trying it out. It has come to my attention that using html entites inside JSX works fine (unlike what is stated in the above jsx-gotchas reference [maybe it's outdated]).
So using something like: R&D
, would output: 'R&D'.
There is a weird behavior with
, which causes it to render differently, thus causing me to think it doesn't work:
<div>This works simply:- -</div>
<div>This works simply:- {'\u00A0'}-</div>
Produces:
This works simply:- -
This works simply:- -
score:0
You can also use ES6 template literals i.e.,
` <li></li>` or ` ${value}`
score:1
Try to use utf-8 nbsp, seem as simple space, but working good without extra code.
Maybe, you should create variable for this.
For copy symbols: https://unicode-table.com/en/00A0/
For generate texts automatically, use some typograf.
score:7
If this doesn't work for you {' '}
then use {'\u00A0'}
.
{' '}
will render a space but there are some cases when you want the line height to also be rendered in a case there you want a space inside an HTML element that has no other text ie: <span style={{ lineHeight: '1em' }}>{' '}</span>
, in that case you'll need to use {'\u00A0'}
inside the span or HTML element.
score:11
You could simply wrap it with Fragment
:
<Fragment> </Fragment>
score:18
Write your jsx
code wrapped in {
}
as shown below.
<h1>Code {' '}</h1>
You can put space or any special character here.
e.g in your case
Select Takeout Scenario:
should be like this
Select Takeout Scenario:{' '}
It will work.
As Advice you should not use  
to add extra space, you can use css to achieve same.
score:37
{'\u00A0'}
works but is hard to read, so I wrapped it in a function component:
components/nbsp.js:
export default () => '\u00A0';
usage:
Hello<Nbsp />world
Source: stackoverflow.com
Related Query
-   jsx not working
- why if-else condition is not working while using in react jsx
- syntax highlighting for JSX not working in sublime text 3
- webpack and react jsx - hot loading not working with docker container
- Precompiled JSX React,js is not working
- Style JSX is not working properly with @media-query in NextJS
- Why is ternary operator in jsx not working
- HTML5 video not working on iphone with react jsx
- onClick inside mapped object JSX for React NextJS not working
- React jsx variable to element inline style not working
- VS Code + React + JSX + Components props intellisense is not working
- JavaScript curly braces not working embeded in string for jsx file in vs code
- React render method not working when referencing jsx file in html
- React Function call not working when mapped in JSX
- Sample ReactJS from reactjs.org code not working with JSX
- require is working jsx file but url() resolve is not wroking in sass file - webpack
- Importing npm linked React JSX project/modules into AngularJS TypeScript module not working
- Why Image attribute is not working in JSX
- JSX conditional rendering not working as expected
- Switch statement not working within JSX (React.js)
- Globbing not working with gulp eslint with jsx files
- React hooks JSX rendering not working properly
- React JSX class library exports are not working
- onClick button event handler not working when using react.js JSX pages
- JSX styles are not working for Storybook after an upgrade
- Javasript inside JSX of react js does not working
- Created basic JSX file to test ReactJS is not working
- onClick attribute for JSX react element not working as expected
- Script with jsx and script without jsx not working on the same page
- forEach() in React JSX does not output any HTML
More Query from same tag
- can't display data form json object with Object.values and .map in React
- Returning html in React
- Material-UI: How to get the value in Slider?
- Finding key in array
- How can you check if there is the same item in an array and do something otherwise?
- Passing props to a component from nested array in React
- setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op
- Persona - onRenderPrimaryText - pass addt'l parameters?
- React change state continuously with while
- How to import a local SVG file in React?
- Is there any way to change where Material-UI adds style tag html elements?
- Clear Apollo cache between tests
- Accessing upload image from Laravel Api in ReactJs Component
- The onMouseLeave function is not called correctly
- Is there an option to show all test descriptions when I run jest tests?
- reactjs - why don't select's get drawn immediately after rendering
- Render html div in react
- React Hooks: Lazy Loading Breaks useLayoutEffect?
- @foreachbe/cypress-tinymce TinyMCE package for Cypress is always returning undefined for editors instance with TypeScript
- Trying to create an array of object values to be used as options for a dropdown
- Argument of type 'FC<ComponentType>' is not assignable to parameter of type 'ForwardRefRenderFunction<unknown, ComponentType>'
- How to save state of column visibility in material ui data grid
- Chart.js x-axis with date DD-MM-YYYY - React
- Send locale.storage email and new email axios post request
- Not getting response on fetching an API
- How do I read my input from text area in react?
- How to send props to component without rendering
- "TypeError: Cannot read property 'preventDefault' of undefined" in react js
- How to rotate material-ui icon
- CSS padding and width issue