File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import React from "react"
1+ import React , { cloneElement } from "react"
22import PropTypes from "prop-types"
33
44//import "./topbar.less"
@@ -112,7 +112,7 @@ export default class Topbar extends React.Component {
112112 } )
113113
114114 control . push (
115- < label key = { 1 } className = "select-label" htmlFor = "select" > < span > Select a spec</ span >
115+ < label className = "select-label" htmlFor = "select" > < span > Select a spec</ span >
116116 < select id = "select" disabled = { isLoading } onChange = { this . onUrlSelect } value = { urls [ this . state . selectedIndex ] . url } >
117117 { rows }
118118 </ select >
@@ -121,8 +121,8 @@ export default class Topbar extends React.Component {
121121 }
122122 else {
123123 formOnSubmit = this . downloadUrl
124- control . push ( < input key = { 1 } className = "download-url-input" type = "text" onChange = { this . onUrlChange } value = { this . state . url } disabled = { isLoading } style = { inputStyle } /> )
125- control . push ( < Button key = { 2 } className = "download-url-button" onClick = { this . downloadUrl } > Explore</ Button > )
124+ control . push ( < input className = "download-url-input" type = "text" onChange = { this . onUrlChange } value = { this . state . url } disabled = { isLoading } style = { inputStyle } /> )
125+ control . push ( < Button className = "download-url-button" onClick = { this . downloadUrl } > Explore</ Button > )
126126 }
127127
128128 return (
@@ -134,7 +134,7 @@ export default class Topbar extends React.Component {
134134 < span > swagger</ span >
135135 </ Link >
136136 < form className = "download-url-wrapper" onSubmit = { formOnSubmit } >
137- { control }
137+ { control . map ( ( el , i ) => cloneElement ( el , { key : i } ) ) }
138138 </ form >
139139 </ div >
140140 </ div >
You can’t perform that action at this time.
0 commit comments