强制RBAC使用React组件

问题描述 投票:0回答:2

[如果我们有一个React组件,可以说正在另一个React组件中渲染的<App />。我可以有<App doSomething/>,以便可以在呈现函数之前调用doSomething函数吗?

[抱歉,要补充上述问题-我想在库中声明doSomething,以便可以在渲染React组件<App doSomething/>之前导入并调用它。

javascript reactjs react-redux
2个回答
0
投票

这里您可以阅读有关生命周期方法的信息。 https://reactjs.org/docs/react-component.html#the-component-lifecycle


0
投票

© www.soinside.com 2019 - 2024. All rights reserved.