Skip to content

Extract TextLayoutManager::baseline() #50888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-native/React/React-RCTFabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Pod::Spec.new do |s|
])
add_dependency(s, "React-FabricComponents", :additional_framework_paths => [
"react/renderer/textlayoutmanager/platform/ios",
"react/renderer/components/text/platform/cxx",
"react/renderer/components/textinput/platform/ios",
]);

Expand Down
9 changes: 0 additions & 9 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2384,15 +2384,6 @@ public final class com/facebook/react/fabric/FabricUIManagerProviderImpl : com/f
public fun createUIManager (Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/UIManager;
}

public final class com/facebook/react/fabric/StateWrapperImpl : com/facebook/jni/HybridClassBase, com/facebook/react/uimanager/StateWrapper {
public fun destroyState ()V
public fun getStateData ()Lcom/facebook/react/bridge/ReadableNativeMap;
public fun getStateDataMapBuffer ()Lcom/facebook/react/common/mapbuffer/ReadableMapBuffer;
public fun toString ()Ljava/lang/String;
public fun updateState (Lcom/facebook/react/bridge/WritableMap;)V
public final fun updateStateImpl (Lcom/facebook/react/bridge/NativeMap;)V
}

public final class com/facebook/react/fabric/events/EventBeatManager : com/facebook/jni/HybridClassBase, com/facebook/react/uimanager/events/BatchEventDispatchedListener {
public fun <init> ()V
public fun onBatchEventDispatched ()V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ import com.facebook.react.bridge.NativeMap
import com.facebook.react.bridge.ReadableNativeMap
import com.facebook.react.bridge.WritableMap
import com.facebook.react.common.mapbuffer.ReadableMapBuffer
import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ReferenceStateWrapper

/**
* This class holds reference to the C++ EventEmitter object. Instances of this class are created on
* the Bindings.cpp, where the pointer to the C++ event emitter is set.
*/
@SuppressLint("MissingNativeLoadLibrary")
@DoNotStripAny
public class StateWrapperImpl private constructor() : HybridClassBase(), StateWrapper {
internal class StateWrapperImpl private constructor() : HybridClassBase(), ReferenceStateWrapper {

private external fun initHybrid()

private external fun getStateDataImpl(): ReadableNativeMap?

private external fun getStateMapBufferDataImpl(): ReadableMapBuffer?

private external fun getStateDataReferenceImpl(): Any?

public external fun updateStateImpl(map: NativeMap)

public override val stateDataMapBuffer: ReadableMapBuffer?
Expand All @@ -51,6 +53,15 @@ public class StateWrapperImpl private constructor() : HybridClassBase(), StateWr
return getStateDataImpl()
}

public override val stateDataReference: Any?
get() {
if (!isValid) {
FLog.e(TAG, "Race between StateWrapperImpl destruction and getState")
return null
}
return getStateDataReferenceImpl()
}

init {
initHybrid()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.uimanager

internal interface ReferenceStateWrapper : StateWrapper {
/** Returns state data backed by JNI reference. The underlying object should not be modified. */
public val stateDataReference: Any?
}
Loading
Loading