I have a modal which should be opened on a button click.
(我有一个模式,应在单击按钮时打开。)
Based on button click, it triggers an open action with an id, this id is added to the state.(基于单击按钮,它会触发一个带有ID的打开操作,该ID被添加到状态中。)
But issue is I am not able to access this id from state before the render of modal (while modal opens).
(但是问题是,在渲染模态之前(模态打开时),我无法从状态访问此ID。)
Flow of events are like this:
(事件流是这样的:)
Button click --> dispatch openmodal action with id --> active prop turns true --> modal opens.
(单击按钮->使用id调度openmodal动作->活动道具变为true->模态打开。)
But before modal render im not able to access the id.
(但是在模态渲染之前,im无法访问ID。)
ask by react doubt translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…