We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
actions.render方法中无法获取异步数据来根据动态数据自定义actionsBar
只要actions.render方法中使用了异步获取的数据,就会一直得不到更新
actions.render中可以依赖函数中使用到的state重新被调用
export const Chat = () => { const [actionsContents, setActionsContents] = useState<string[]>([]); useEffect(() => { fetch('/xxx').then((res: string[]) => { setActionsConfig(res) }) }, []) return ( <ProChat actions={{ render: () => { // 这里的actionsContents会一直是默认值 return actionsContents.map(actions => ( <button>actions</button> )) } }} /> ) }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
🐛 bug 描述
actions.render方法中无法获取异步数据来根据动态数据自定义actionsBar
📷 复现步骤
只要actions.render方法中使用了异步获取的数据,就会一直得不到更新
🏞 期望结果
actions.render中可以依赖函数中使用到的state重新被调用
💻 复现代码
© 版本信息
The text was updated successfully, but these errors were encountered: