Supercharge Your Innovation With Domain-Expert AI Agents!

Method and device for transmitting native object between React Native components

An object and component technology, applied in the field of ReactNative, can solve problems such as how to manage the life cycle of native objects

Active Publication Date: 2017-06-13
BEIJING 58 INFORMATION TTECH CO LTD
View PDF2 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the ReactNative framework cannot convert some special native objects such as image objects, custom models, etc. into javascript-recognizable objects, and can only treat the memory address of the native object as a hexadecimal number or string; One problem is how to manage the life cycle of the native object after the object is handed over to javascript

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for transmitting native object between React Native components
  • Method and device for transmitting native object between React Native components
  • Method and device for transmitting native object between React Native components

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0022] Such as figure 1 and figure 2 As shown, the method for transferring native objects between React Native components disclosed in this embodiment includes: Step S2: the memory data management module transfers the first React Native component (such as figure 2 The native object to be boxed in the React Native component A) is packaged as a boxed object of a general type; Step S4: the first React Native component sends the boxed object to the javascript business logic module; Step S5: the second React Native component ( Such as figure 2 The react native component B) receives the boxed object forwarded by the javascript business logic module; step S6: the memory data management module unboxes the boxed object to obtain the native object.

[0023] In this embodiment, by encapsulating the memory data management module on the native end, the encapsulation and unboxing operations of the native objects to be boxed are realized, and the transfer of the native objects that cann...

no. 2 example

[0026] Such as figure 2 As shown, on the basis of the first embodiment, step S2: the memory data management module converts the first ReactNative component (such as figure 2 After the native object to be boxed in React Native component A) in React Native component is encapsulated into a boxed object of general type, the method for transferring native objects between React Native components in this embodiment also includes: Step S3: saving the box to be boxed A strong reference to the native object. The purpose of this embodiment is that when boxing, the memory data management module retains a strong reference to the native object to be boxed to prevent the native object from being released.

[0027] Further, step S3: After saving the strong reference of the native object to be boxed, the method for transferring native objects between ReactNative components in this embodiment further includes: Step S8: the javascript business logic module sends a release command to the memor...

no. 3 example

[0029] Such as figure 2 As shown, on the basis of the first embodiment and the second embodiment, step S2: the memory data management module converts the first React Native component (such as figure 2 Before the native object to be boxed in the React Native component A) is packaged as a generic type of boxed object, the method for transferring native objects between React Native components in this embodiment also includes: the first React Native component calls memory A boxing method of the data management module; correspondingly, step S6: before the memory data management module unboxes the boxed object to obtain the native object, the method for transferring the native object between React Native components in this embodiment also includes : the second React Native component (like figure 2 The ReactNative component in B) calls the unboxing method of the memory data management module.

[0030] In this embodiment, a memory data management module is established on the nati...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for transmitting a native object between React Native components. The method for transmitting the native object between the React Native components comprises the steps that a native object of a box to be packed of a first React Native component is encapsulated as a vanning object of a common type by a memory data management module; the vanning object is sent to a javascript business logic module by the first React Native component; the vanning object forwarded by the javascript business logic module is received by a second React Native component; the native object is obtained after a devanning operation is conducted on the vanning object by the memory data management module, and any types of native objects are transmitted through javascript.

Description

technical field [0001] The present invention relates to the technical field of React Native, in particular to a method and device for transferring native objects between React Native components. Background technique [0002] React Native is a technology that allows developers to use front-end languages ​​to build native apps. Its principle is to encapsulate native UI components to achieve the purpose of using javascript to deploy native UI components to build interfaces. The built native App has the flexibility of web App and has the advantages of a good interactive experience. [0003] In actual development using React Native, it is often necessary to transfer data between React Native components / APIs through javascript, that is, one of the React Native components / APIs sends data to javascript, and javascript sends the data to another after business processing React Native components / APIs to use. The general types of data are integer, floating point, string, array, dictio...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/44
CPCG06F9/4488
Inventor 杜艳新
Owner BEIJING 58 INFORMATION TTECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More