Skip to content
New issue

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

add lazy props for screen rendering #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ The component extends `FlatList` so all FlatList-props are valid.
| renderPrevButton | `function` | renders a Text-component | Use to supply your own prev button . Has no effect if using `renderPagination` |
| renderDoneButton | `function` | renders a Text-component | Use to supply your own done button. Has no effect if using `renderPagination` |
| renderSkipButton | `function` | renders a Text-component | Use to supply your own skip button. Has no effect if using `renderPagination` |
| lazy | `boolean` | false | Render single screen at a time if true (for optimization purpose) |

### Methods

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-app-intro-slider",
"version": "4.0.4",
"version": "4.0.5",
"description": "Simple and configurable app introduction slider for react native",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ export default class AppIntroSlider<ItemT = any> extends React.Component<
extraData={extra}
onLayout={this._onLayout}
// make sure all slides are rendered so we can use dots to navigate to them
initialNumToRender={data.length}
initialNumToRender={this.props.lazy?1:data.length}
maxToRenderPerBatch={this.props.lazy?1:10}
{...otherProps}
/>
{renderPagination
Expand Down