I'm constructing an object, and only one of its properties should be changed by according to another value, so a switch would be ideal, but I can't put a switch inside the initialization of the object. I know it's probably something fairly easy, but I'm new to JS.
class DegreesCircle extends React.Component {
constructor(props) {
super(props);
this.state = {
type: this.props.type,
degrees: this.props.degrees
}
}
render() {
let circleStyle = {
position: "relative",
left: "50%",
top: "45%",
transform: "translate(-50%, 0)",
//I need this to change according to this.props.type
//I'd put a switch in here if I could
borderColor: "a value",
borderStyle: "solid",
borderWidth: "0.5vh",
borderRadius: "50%",
width: "20vh",
height: "20vh",
}
How would I change only the borderColor property of circleStyle?
EDIT: I am not looking to put the switch in front or something. I am looking into changing one property of an object.