Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-native-synchronous-list
Advanced tools
A react-native list (for iOS only) that renders it's children synchronously
This is an infinite list implementation that uses a template defined in javascript to render it's (native) children through an interesting mechanism called synchronous rendering first envisioned by Tal Kol from wix.
Because trying to render children on the fly while scrolling sends to much information through the RNBridge and blocks it. As a result we see a white flicker when scrolling fast, plus it doesn't give the native feeling that native lists give.
Here's his initial proof of concept project:
1 . $ npm install --save react-native-synchronous-list
or
$ yarn add react-native-synchronous-list
2 . $ react-native link react-native-synchronous-list
3 . Run the project
You should able to see this:
iOS | Android |
---|---|
That's still a WIP project and you should definitely not use it as it is on production apps.
Basically you first register a template synchronously by invoking the SyncRegistry.
Here's how a template looks like and here's where we register it.
So we'll declare that jsx template and the native code will create a recipe out of it. Next time we want to create that view, the native code will create a new view based on that recipe (without the need to go to javascript) - it all happens on the native side now.
Prepare the native component for rendering
this.synchronousList.prepareRows();
In the example we just do it whenever we first get a ref of the list.
Then all you have to do is render the list like a normal js component.
Name | Type | Description | Default |
---|---|---|---|
data | array | REQUIRED The data that we'll be mapping to our views | - |
numRenderRows | number | REQUIRED The total views we'll be re/using (this list is recycling views remember?). Choose a value that's big enough so that the rows cover at least 1 screen. | - |
loopMode | string | Either no-loop (typical list), repeat-empty (a list that repeats empty views after we're out of data or repeat-edge (a least that repeats views that were in the beggining of our data once we're out of data (infinite loop mode) | no-loop |
horizontal | bool | Wether we'll be running the list in horizontal mode or vertical | false |
dynamicViewSizes | bool | True if we'll be calculating the row sizes based on the props data or false if we'll be using the rowHeight and rowWidth static values | false |
rowHeight | number | The height of each row when using the list in static row size mode. | - |
rowWidth | number | The width of each row when using the list in static row size mode. | - |
templateName | string | The name of the template object we'll be using. (No need to change that) | 'RNSynchronousListRowTemplate' |
See the RNExample folder
TODO | Status |
---|---|
Recipe registration implementation | ✅ |
SyncRootView implementation | ✅ |
RecyclerListView implementation | ✅ |
RecyclerListView row item item (extends SyncRootView ) | ✅ |
Reload working ( RN Issue here ) | :x: |
MIT © Ioannis Kokkinidis 2017-2018
FAQs
A react-native list (for iOS only) that renders it's children synchronously
The npm package react-native-synchronous-list receives a total of 5 weekly downloads. As such, react-native-synchronous-list popularity was classified as not popular.
We found that react-native-synchronous-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.