My code works until I try and pass props AND functions to my child component.
import React from 'react';
import './App.css';
export function Key(props, {newText, setNewText}) {
const handleClick = () => {
setNewText(newText + props.value);
}
return (
<button onClick={handleClick}>{props.value}</button>
);
}
export default Key;
If I remove the props from the export section the code works fine - unfortunately I need to access the data being passed.
Any help appreciated.