How to create an array outside class component or reference state sibling to next sibling React.js
问题 I need a solution for radio buttons, but the options array which is the main array is outside the class component. In this case, I will get OPTIONS array items through props but not hardcoded. How is it possible for me to Pass props outside class component Make OPTIONS state object and then pass it to checkboxes, which is inside state. import React, { Component } from "react"; import Checkbox from "./Checkbox"; const OPTIONS = ["One", "Two", "Three"]; class App extends Component { state = {