Skip to content

index

Internals

Architecture

React Native Bridge: React Native bridge is a C++/Java bridge which is responsible for communication between the native and Javascript thread. A custom protocol is used for message passing.

Now, the spawned[被产生的] Javascript thread starts issuing instructions to the native thread via the RN Bridge. The instructions include what views to load, what information is to be retrieved from the hardware, etc. For example, if the JS thread wants a view and text to be created it will batch the request into a single message and send it across to the Native thread to render them.

serialized Information: [ [2,3,[2,'Text',{...}]] [2,3,[3,'View',{...}]] ]

  • Main thread: Touch Event

  • Javascript thread

  • Layout

image-20220801214037136

ShadowTree == Layout

Notes:

IOS has butil-in JS VM while ANDORID need to be parcled with.