【发布时间】:2020-12-21 15:33:07
【问题描述】:
我目前正在学习 ReactJS,我想使用 fullPageJS。它工作正常,但有些语法我不太明白。
组件:
function home() {
return (
<ReactFullpage
render={({ state, fullpageApi }) => {
return (
<ReactFullpage.Wrapper>
<div className="section">
<h1>Slide 1</h1>
</div>
<div className="section">
<h1>Slide 2</h1>
</div>
</ReactFullpage.Wrapper>
);
}}
/>
)
}
export default home;
现在我的问题是,render={({ state, fullpageApi }) => { return(); }} /> 做什么?我可以看到它是一个属性,但我真的不明白它的用途。
【问题讨论】:
-
阅读官方文档。 Render Props
标签: javascript reactjs fullpage.js