Copyright notice: This article is Marno original, reproduced must be in a clear position to indicate the source! Reprint address: juejin.cn/post/684490… Note: original is not easy, welcome [praise] and [praise]
-
【Marno】The original link
-
Learn more about React Native in Marno’s short book featureReact-native development camp”
-
React Native technology (aMarno
One, foreword
Not many people like to read the update log, so I’ll just summarize it. Overall, a few bugs have been fixed in previous versions and a few minor features have been added to both Android and iOS. It also claims to have improved the efficiency of detecting attribute changes, since attribute changes mean rerender, so the update is officially stricter in detecting attribute changes. But to what extent is unknown.
As for efficiency, which many people are concerned about, it doesn’t seem to be a big improvement. After all, it’s a routine upgrade, so it makes sense.
But here are the highlights:
1. Attributes support percentage parameters, currently only support (padding, margin, width, height, minWidth, minHeight, maxWidth, maxHeight, flexBasis). 2. When init project, you can create a template project with some common pages. But at present, there seems to be less template, specific can see here [stamp I am right]. I’m looking forward to this feature, if only custom templates could be supported.
That’s about it. If you want more details, you can read on. Please click the link at the top of this article to see the original English article. Translation of the comparison of water, no one to correction, you feel free to have a look!
2. Major changes
IOS /Android dual platform:
- Verification method and efficiency when optimization attribute changes
The Android platform:
-
The default windowSoftInputMode mode of a newly created application is changed.
Adjustadjustsize (adjustResize) is changed from The default AdjustMode attribute to adjustResize for all new activities created through React-Native init. This is a Native way to address the Android keyboard blocking input box issue rather than using JS solutions such as the KeyboardAvoidingView component we used earlier.
-
Remove JSBundleLoader. GetSourceUrl () method.
If you use the following API: 1. JSBundleLoader. GetSourceUrl () 2. ReactInstanceManager. GetSourceUrl () 3. ReactInstanceManager. GetJSBundleFile () must now be changed to call: 1.CatalystInstance.getSourceURL() 2.JSBundleLoader.loadScript()
-
Remove RecyclerViewBackedScrollView components
This component was added a long time ago to solve the scrollback-when-data-is-added bug, but has now been solved directly by ScrollView internal code.
New features
1. IOS /Android dual platform:
- Added injectJavaScript method to WebView component
This method supports injecting JS code directly into the WebView component, but cannot be used to execute JS code after the page has loaded.
2. The Android platform:
- Make the layout animation adhere to the opacity set in the style
- New selectionColor property for Text component
- Added the overScrollMode property to the ScrollView component
- Java bindings that implement custom baseline functions
- TextInput: Avoid triggering onSubmitEditing twice
- Scrollview. scrollToEnd through Native code
- Support for calling and returning arbitrary types from Java synchronous hooks
- The Switch component supports the tintColor and thumbTintColor properties
- Slider supports custom thumb, track, and Progress attributes
- Add null checks to Dynamics
- Add the missing import to the BUCK file
- The introduction of FallbackJSBundleLoader
- Improved error reporting mechanism for nested components in Text components
- Allow components to collapse after pointerEvents is set
- Change the default DomStorageEnabled attribute of the WebView to true
- Allows view Manager to be accessed as a Native module
- You do not need DevSupportManager to create a DevInternalSettings
- Delete ModuleRegistryHolder
- Make the consumption of the NativeArray explicit
3. The iOS platform
- Add a keyboardType parameter to the alertios.prompt () method
- Add instructions for RCTEventEmitter
- Remove deprecation warnings for RCTExecuteOnMainThread
- Added a new way to handle concurrent gesture recognition in RCTTouchHandler
- RCTTouchHandler no longer delays any touches
- Delete expired method ‘RCTExecuteOnMainThread’
- Disable RCTPerfMonitor on the new Bridge
- Update the nativecomponentsios.md document
- RCTConvert: NSStringArray Typedof is not recommended
- Remove the RK/RCT prefix from NativeModules
- Added the option to enable Sampling profiler at app startup
- Use int instead of NSInterger for ABI compatibility
- Stop copying unused JS files to the Pods folder
- Display redbox when there is no bundle
- Automatically closes Redbox when reloading is pressed
- ‘Cannot calculate shadow benefit’ no longer generates a warning
- Better implementation of intrinsicContentSize
- Deprecate or remove setFrame, setLeftTop, etc
- Uimanager.measure () supports view Hierarchy under any zoom effect
- Provide JS with Native runtime environment and parameters are test, development or production environment mode
- You can disable yellow Box warnings by configuring environment variables
4. Other
- Update React to 15.4.1.
- Add percentage support for some attributes of the component, currently supported (padding, margin, width, height, minWidth, minHeight, maxWidth, maxHeight, flexBasis).
- JSC heap capture adds other roots to the visualization.
- Add scrollToEnd methods to ScrollView and ListView.
- Packager: Adds an internal program to log errors.
- Add symlinks under node_modules as part of projectRoots.
- Add cell size to JSC Heap Capture visualization.
- For Navigation. The Header. Add style and imageStyle BackButton properties.
- You can use the ‘react-native’ command to create projects that specify type templates
- The README is created when the project is initialized with ‘react-native init’
- You can create a project with a navigator directly by using ‘react-navigation’
- Install or uninstall the package using Yarn
- Run the program through the package.json script
- Faster source map generation
- High-perf source map builder
- Add the removeAllListeners method to AnimatedValueXY
- You can control the cache policy for the image
- Supports copying to clipboard on Windows
- Use FBJS /lib/invariant instead of invariant
- Allows custom styles to be set on the scene stack
- Move the C ++ bridge to the OSS directory
- XHR: support typed arrays for request payloads
- NativeAnimated allows you to drive any number of attributes
- Make sure the document is linked to the correct address
- Avoid empty _inputRef in TextInput
- Allows a dark background in the debugger view
- When row is slid to the closed position, clear openRowID appropriately
- Remove the maximum limit on actions in SwipeableQuickActions (previously 2 limit)
- Allows aspect ratios beyond the boundaries of the parent component
- Transfer the padding information of the TextUpdate to the Text Input component
- There is no limit to using absolute to locate child components in parent components of size 0
4. Fix bugs
1. IOS /Android dual platform:
- Fix the size of the parent when the child overflows the parent
- Skew Transform fixed in Native code
2. The Android platform:
- Fixed JSC crash in dev mode
- Fixed an exception thrown during startup
- Fix ListView slide blocking problem
- Fixed typos in nativemodulesAndroid. md file
- Fixed UIExplorer going into broken state
- Fixed bug Mc-117634 – Call webView. postMessage throws not a constructor in webview
- Fixed an invalid custom font for placeholder characters for TextInput
- Fix the potential NPE in UIViewOperationQueue
- Fixed misplacement of the start position of a component using LayoutAnimation while in animation state
- Reset pointerEvents to null
3. The iOS platform
- Fixed an issue where TextInput automatically calls back to onChange() after correction is enabled
- Fixed official test case: added -objc and -LC+ + test targets
- Repair passThroughTouches
- Fixed nil TVView on pop
- Fixed compile-time warnings about incorrect index types
- Fix other compilation warnings by adding the __unused args flag
- Make CocoaPods available
4. Other
- Correct spelling errors in PixelRatio. Md
- Fixed gesture return direction error in VerticalSwipeJump mode
- Fixed a crash of the packer on Node4
- Fixed an issue with loading minified bundles over HTTP
- Fixed how line breaks are evaluated when using the min-size constraint
- Fixed skew the transformation
- Correct spelling errors in Yoga Classes
- Correct spelling of string information in the WebView example
- Correct spelling errors in resolutionRequest.js
- Fixed an absolute position issue with Center or flex-end on align-item or context-content
- Fixed navigator scene collapsing incorrectly
- Fixed inaccurate aspect ratio when using margin
- Fixed app crash (finally fixed!!)
- Break an infinite loop that only occurs in the debug environment