question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Further improvements for RNW

See original GitHub issue

There are a few places where I think the implementation could work better with RNW. The “web” implementation may be OK for React DOM apps, but since it doesn’t rely on RNW at all, it can’t provide related functionality like automatic RTL layout flipping. The “react-native” implementation on web pulls in Animated which can add to the bundle size and runs animations on the main thread. I noticed some helpful ScrollView props like scrollEnabled are not available either.

react-native implementation

DefaultJSItemAnimator

You could create a separate .web.js implementation that doesn’t import Animated and instead relies on CSS transitions (as the web implementation does).

Related question: I’m not sure why there is a web-specific fork in this code. Why is native getting passed left/top props rather than a style prop?

    private _getNativePropObject(x: number, y: number): object {
        const point = { left: x, top: y };
        return !IS_WEB ? point : { style: point };
    }

web implementation

The layout of the wrapping divs in some components doesn’t match RN, as they are not styled the same as the view flex containers.

ScrollViewer.tsx

Remove componentWillMount and replace componentWillReceiveProps with componentDidUpdate.

scrollTo can be smoother by relying on the browser’s built-in smooth scrolling, which RNW relies on in ScrollView.

You might also want to include a caveat about using RNW + window scrolling + Touchable items. The Touchables expect to be in ScrollView to correctly transfer the responder to the scroller as needed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
naqvitalhacommented, Aug 22, 2019

Most of these are solved in v2. Closing.

0reactions
naqvitalhacommented, Mar 19, 2018

Eventually yes. First onLayout needs to be figured out to justify the performance cost. Anyways, the current implementation is working pretty well performance wise. Btw since everything is proxied through setNativeProps don’t you think you should try running it on a worker? Compute one frame early, I think the perf results will be amazing

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReNew: Value-Growth Mix But Not A Buy Yet (NASDAQ:RNW)
The projection comes from the Indian government's target to install an additional 360GW renewables capacity by 2030 at a CAGR of 17.4%.
Read more >
Are Poor Financial Prospects Dragging Down TransAlta ...
TransAlta Renewables (TSE:RNW) has had a rough three months with its share price down 24%. Given that stock prices are...
Read more >
Investing in TransAlta Renewables (TSE:RNW) three years ...
Investors in TransAlta Renewables had a tough year, with a total loss of 9.7% (including dividends), against a market gain of about 0.7%....
Read more >
RNW.TO - Transalta Renewables Stock Options Prices
Pull these symbols into the Screener to further apply filters that match your investing criteria. Screen using 100's of filters like new ...
Read more >
RNW RH2 Principles_2021-12-03 - Renewable Northwest
Looking at hydrogen from the lens of decarbonization, it is more ... carriers like ammonia is another area where further improvements may be ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found