Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

415
Views
How do I add a drop down list in react js within a table?
var ListItem = React.createClass({ displayName: "ListItem",
  getInitialState: function () {
    return {fruit: this.props.value.product.fruit, meat: this.props.value.product.meat, vegetable: this.props.value.product.vegetable, total: 0 };
  },



render: function () {
    return (
      React.createElement("tr", null, 
      React.createElement("td", null, React.createElement("input", { type: "text", name: "fruit", value: this.state.fruit, onChange: this.handleChange, placeholder: "fruit" })), 
      React.createElement("td", null, React.createElement("input", { type: "number", name: "meat", value: this.state.meat, onChange: this.handleChange, placeholder: "..." })), 
      React.createElement("td", null, React.createElement("input", { type: "number", name: "vegetable", value: this.state.vegetable, onChange: this.handleChange, placeholder: "..." })), 
      React.createElement("td", { className: "total" }, this.state.total)));
  },

Now I want to change Fruit, Meat and Vegetable to "form" instead of "input" with drop down options so when I click on Fruit I will have drop down options of "apple, banana, strawberry". Meat options will be "pork, beef, lamb" etc...

I've try using

return React.createElement("select", {},
  React.createElement("option", {value: "A"}, "Option A"),
  React.createElement("option", {value: "B"}, "Option B"),
  React.createElement("option", {value: "C"}, "Option C")
);
but it doesn't work :(
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!