Questions tagged [jsx]

For questions about the JSX syntax used by React.js, Vue, and other front-end JavaScript frameworks that allows inline XML literals to be used in JavaScript to describe HTML elements. If your question is about Adobe's extended implementation of JavaScript (ExtendScript) which is at least five years older than React.js, use the [ExtendScript] tag instead.

JSX syntax is used by , , and other front-end JavaScript frameworks that allows inline XML literals to be used in JavaScript to describe HTML elements.

Resources

8973 questions
2
votes
2 answers

is it possible to use material ui tabs and still use react router?

I have customized code from the Tabs component in material ui,
chris56tv
  • 147
  • 1
  • 2
  • 10
2
votes
1 answer

Alternative for ternary operator in the case a ? a : b without repetition (JavaScript)

The scenario is the following: I want to return the value of a when a is defined and else I want to return b. I need an expression because of JSX. I am looking for a better way to write the expression a ? a : b where a and b are variables. I was…
user
  • 117
  • 9
2
votes
2 answers

StencilJS Props not populating in JSX

I've been learning and practicing Stencil JS and I'm creating a card component. I have several props that are meant to populate the card's content. While the card and its styling show up fine when I render the page the card does now show any of the…
Alex Merced
  • 118
  • 1
  • 10
2
votes
2 answers

How to add a ClassName and remove it onScroll event in React.JS?

I'm trying to make a Sticky Header that can change its background-color based on his position on the page. To do that, I'm trying to add a className "active" to my Styled Component "StyledHeader" that will appears when the scrollPositionY is above…
Dabu
  • 27
  • 1
  • 7
2
votes
1 answer

While compiling my react app I am getting Module build failed: SyntaxError: Unexpected token

I have attached the required code below, I would appreciate if anyone can help me with it. My app.js is: import React from 'react'; import ReactDOM from 'react-dom'; import IndecisionApp from './components/IndecisionApp'; import…
Vikrant Bhat
  • 2,117
  • 2
  • 14
  • 32
2
votes
3 answers

How to add background image from local folder to a container

I want to set the background image of a container div from an image from a local folder. Does anyone know what i need to add to my code/ how to edit it to do this? Currently the image isnt showing for some reason. class Team extends…
Sean
  • 587
  • 4
  • 20
2
votes
1 answer

Why does React Router Change URL but doesn't Change the View

I have created a react 16.8 application and am using react-router-dom. I built the Navigation Bar with React Semantic UI library. My Problem is that when I click the Menu Item Navlink the App changes the url however, it does not rerender the app…
Bama
  • 577
  • 4
  • 21
2
votes
1 answer

Ternary Operator in React/JSX Not Working

I'm mapping data from an eBay API pull, and trying to display an icon if the value equals true or nothing if false. The field is called bestOfferEnabled and is either a value of 'true' or false. This is example dataset…
John Rogerson
  • 1,153
  • 2
  • 19
  • 51
2
votes
1 answer

Custom template not taken into account in vue-tables-2

With vue-tables-2, I created a custom template from the default one, to add pagination on top. My problem is that the custom template is not taken into account when requiring it. The default template is still displaying, even if I remove large parts…
Samy Kacimi
  • 1,216
  • 9
  • 23
2
votes
2 answers

Why we don't need to add semicolon to the end of jsx?

I'm new to React and JSX, just a question on JSX syntax, we know we can do like: export default function App() { return

Hello World

} but don't we need to add semicolon to the end of jsx ? As: export default function App() { return…
user9623401
2
votes
1 answer

How to use WebView to show React jsx file

I can't see any support to React jsx local file. How can I use them in WebView ? Can someone help me . I'm using in this case like this:
Kakata Kyun
  • 573
  • 1
  • 5
  • 12
2
votes
2 answers

props.array.map is not a function

I have a few components that are to render dynamically based on values passed through props. My main component(1) is dynamically creating its subcomponents(2) and passing values into those components via props. Each component(2) created is then…
Digglit
  • 576
  • 1
  • 4
  • 11
2
votes
1 answer

How to make chat like UI with chat bubbles in React JS

I have some JSON data in dummyData. I am not sure how can I place the chat bubbles on left and right according to the direction. I am using Material UI and context API. Image for the reference. I don't want to use any library other than material…
Gaurav
  • 857
  • 3
  • 21
  • 29
2
votes
3 answers

React functional parent component sharing common onChange functions without redundant code

React can pass onChange functions from functional parent to functional child for the child to use to update the parent. But writing the same onChange functions in several Form building components seems redundant - and I'm hoping there's a better way…
2
votes
1 answer

how to disable datepicker depending on value in select tag in ANTD table

I have a ANT table inside one of the forms I'm developing. there is one select and 2 date pickers in this table. the date pickers need to be disabled when a particular value is selected in the select operator. how can i do this. please help. …
Arun K Anil
  • 95
  • 2
  • 12
1 2 3
99
100