Below is my code.(下面是我的代码。)
CHILD COMPONENT(儿童组件)
const onSave = () => {
var val = value
props.onSave();
}
<div onClick={() => { onSave() }}>
<CheckButton variant="contained" text-align='center' />
</div>
PARENT COMPONENT(父母组成)
export const Card = (props) => {
const onSave = (val) => { [I WANT TO ACCESS val within here] }
}
<TextInputContainer onSave={() => onSave()} />
Is there any way I can access that variable val
inside the parent component?(有什么方法可以访问父组件中的变量val
?)
The code is truncated big-time.(该代码被大截断。) The actual code uses Redux.(实际代码使用Redux。)
ask by abiodunt translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…