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

98
Views
how to disable radio button in react

if I give only disable property its not working how to make radio button disable

import React from "react";
const App = () => {
      let platformData = ["And", "win", "ios"];
      let platform = "platform";
    
      return (
        <div>
          <input
            type="radio"
            disabled
            name="Platform"
            id="Platform"
            radioList={platformData}
            radioName={platform}
          />
        </div>
      );
    };
    
    export default App;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simple solution to this problem you need to pass in disabled={true} or you could do something like this

import React from "react";

const App = () => {
  let platformData = ["And", "win", "ios"];
  let platform = "platform";
  let disabled = true;

  if (platform) // or any other kind of condition
      disabled = false;

  return (
    <div>
      <input
        type="radio"
        disabled={disabled}
        name="Platform"
        id="Platform"
        radioList={platformData}
        radioName={platform}
      />
    </div>
  );
};

export default App;
about 4 years ago · Juan Pablo Isaza Report
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!