JSX for...in loop

React JSX
Given this object: lst socials = { foo: 'http://foo' } I want to loop through it in JSX. This works: let socialLinks = [] let socialBar for (let...
10 months ago

Conditional logic jsx react

React JSX
I am trying to apply more than 1 condition to className in my jsx view. However it won't let me. It only listens to the first condition. className...
10 months ago

Electron with JSX

React JSX
I am writing desktop app with Electron from Github, and I am using React with it. One thing I notice is that because Electron uses io.js, I no longer ...
8 months ago

Client-side JSX transpiling

React JSX
I want to create React applications with JSX and not have to use a terminal or any server-side/dev environment commands. The environment we are using ...
7 months ago

Conditional link in JSX

React JSX
I'm trying to write a way to render links conditionally. I have the following function: const renderLinkIf = (content, condition, href) => { if ...
4 months ago

Mixed operators in JSX

React JSX
I'd like to use mixed operators in JSX, for example: {datas && datas.map(function(data,i){ return <MyComponent key={i} />}) || []} Wh...
6 months ago

Append string to JSX

React JSX
In the below code sample, I need to add the string " : " only if the twitter props is set. What is the right way to do this? let User = React.createC...
6 months ago

ReactJS without JSX

React JSX
I am using React to generate a decently huge and complicated DOM tree structure but I choose not to go with JSX (just to avoid the eventual and unavo...
5 months ago

React: dynamic import jsx

React JSX
This question related to dynamically importing JSX files into React. Basically we have one main component that dynamically renders other components ...
1 month ago

ESLint validate JSX file

React JSX
I use ESLint to check my react code. However, it cannot identify the variable in react component tag. ESLint throw the error 'no-unused-vars' to me(th...
30 days ago

REACT JSX - Chained conditons

React JSX
The following code works for me and gives me the expected results but I have doubts if I am doing it right. { Conditon1?<ChildComponent />:C...
22 days ago

Join JSX with JSX

Javascript
I've got a situation where I have several labels, with separator arrows in between them - sort of like breadcrumbs. The last label has no arrow after...
1 month ago

React JSX compiling

Javascript
I'm trying to add the class name "active" to links when they are clicked. I can't get this JSX to compile. <li onClick={this.showDeals}>&...
1 year ago

React, Unterminated JSX contents

Javascript
I am trying to set up a basic react example - using jspm/systemjs and babel. I have this code here to show a simple page and am getting an error im...
1 year ago

loop inside React JSX

Javascript
I'm trying to do something like the following in React jsx (where ObjectRow is a separate component) <tbody> for (var i=0; i < numrows; ...
1 year ago

React: Unterminated JSX contents

Javascript
Why do I get the error Unterminated JSX contents for the closing div-element? What am I doing wrong? export default class Search extends Component { ...
6 months ago

React w/ JSX: Load class defined in JSX into HTML

React JSX
I am new to React and have attempted going through a few tutorials but do not have luck so I resort to asking question here. My setup: I have a .jsx ...
1 year ago

JSX- How can I manipulate strings in JSX?

React JSX
I have a string in a JSX file that I have to manipulate this way: Let's suppose I have the following string with this value medical_specialty = "Plas...
11 months ago

JSX Inline function (programatically set?)

React JSX
I want to check for a true value on a state and set a class accordingly. The code below does just this, However... Is there a way to do this programa...
10 months ago

ESLint React PropTypes with JSX

React JSX
I'm using the Airbnb javascript standards to lint my react app and i'm getting an error i'm not sure how to fix. I'm passing in another component in o...
9 months ago