I have a field that displayed list of "Template name".
The remove button supposedly will delete the Template name, but somehow failed to delete the selected Template from display.
let EditChannelForm = props => {
const {channelKeys, channelType} = props;
let fields;
if (channelKeys) {
fields = channelKeys.map((ck, index) => {
if(ck.key === "templateName") {
return (
<div key={ck.key+ index}>
<li key={ck.key + index} style={styl}>
<Field
component={renderField}
validate={[required]}
label={changeCase.titleCase(space(ck.key))}
name= {ck.key + index}
/>
<Button type="danger" icon="delete" onClick={() => channelKeys.remove(ck.key + index)} >Remove</Button>
</li>
</div>
I got the error
channelKeys.remove is not a function
Is there anything I need to change in onClick={() => channelKeys.remove(ck.key + index)} ?