Reactjs Mobile-compatibility issues Summary

Source: Internet
Author: User

Summary of the use of Reactjs in car H5

Q: Android 4.4webview display blank?

A: The initial suspicion is that the CSS property is not prefixed with the compatibility problem, but added after the discovery is not, through WebView debugging after the console output Set is undefined, after the search found react dependent collection type Map and set. So if you want to be compatible with a low-version browser you can introduce a global polyfill, such as Core-js or Babel-polyfill.  

Q: Android Low Click event does not take effect?

A: The debug check found that the for-for syntax was used in this click event and could not be compatible with the lower version, which can be replaced with the map or foreach method.

Q: CSS files imported using @import are not automatically prefixed by autoprefixer?

A: Check found that some flex and Transfrom properties do not have a compatible prefix, but the project introduced a plug-in autoprefixer automatically added prefix, after the comparison code found in Scss file using @import introduced files are not successfully added, This problem can be solved by introducing postcss-import.  

Q:android Line-height not centered on the problem?

According to the analysis of the reasons:

1. Do not use the odd number of the font size, not to mention the decimal point. That is, integers divisible by 2 and must not be less than 12px.  

2. When using REM units (the root element font may not be an integer if the root element changes dynamically).

Because the method on the Internet is not so, and then think of a way to use the line-height to set the vertical center of the label are changed to button ... It's all right!  

Q: Does the mobile end use Overflow-auto to achieve rolling lag?

A: Add attribute -webkit-overflow-scrolling:touch; //With rebound effect

Q:android WebView Debugging method

Pre-condition android4.4+

1. Enable WebView debugging in the app, Chrome Devtools can debug the WebView remotely after the debugging is turned on;

Webview.setwebcontentsdebuggingenabled (TRUE);

2. By accessing chrome://inspect/#devices访问已启用调试的 WebView list, click Inspect to debug, if you cannot debug the page blank Fq.  

Reactjs Mobile-compatibility issues Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.