Skip to content

Commit

Permalink
Retrieve reconciliation from ComponentsConfig
Browse files Browse the repository at this point in the history
Summary: I noticed that we missed few default settings for reconciliation, which should be retrieved from component config, otherwise, reconciliation is always disabled.

Reviewed By: adityasharat

Differential Revision: D52964418

fbshipit-source-id: 83ed2ec6555c4a07be0738289328ad8ca9d2e80b
  • Loading branch information
Andrew Wang authored and facebook-github-bot committed Jan 23, 2024
1 parent 899ad82 commit c8837b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ abstract class CollectionLayout(
reverse: Boolean,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
componentContext.lithoConfiguration.componentsConfig.isReconciliationEnabled,
isIncrementalMountEnabled: Boolean =
componentContext.lithoConfiguration.componentsConfig.incrementalMountEnabled,
hasDynamicItemHeight: Boolean = false,
Expand Down Expand Up @@ -124,7 +125,8 @@ internal object CollectionLayouts {
reverse: Boolean = false,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
componentContext.lithoConfiguration.componentsConfig.isReconciliationEnabled,
crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap,
mainAxisWrapContent: Boolean = false,
preallocationPerMountContentEnabled: Boolean,
Expand Down Expand Up @@ -166,7 +168,8 @@ internal object CollectionLayouts {
reverse: Boolean = false,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
componentContext.lithoConfiguration.componentsConfig.isReconciliationEnabled,
columns: Int = 2,
preallocationPerMountContentEnabled: Boolean,
): CollectionLayout =
Expand Down Expand Up @@ -204,7 +207,8 @@ internal object CollectionLayouts {
reverse: Boolean = false,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
componentContext.lithoConfiguration.componentsConfig.isReconciliationEnabled,
isIncrementalMountEnabled: Boolean = true,
spans: Int = 2,
gapStrategy: Int = StaggeredGridLayoutManager.GAP_HANDLING_NONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ inline fun ResourcesScope.LazyGrid(
noinline onDataRendered: OnDataRendered? = null,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
context.lithoConfiguration.componentsConfig.isReconciliationEnabled,
childEquivalenceIncludesCommonProps: Boolean = true,
overlayRenderCount: Boolean = false,
alwaysDetectDuplicates: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ inline fun ResourcesScope.LazyStaggeredGrid(
noinline onDataRendered: OnDataRendered? = null,
rangeRatio: Float? = null,
useBackgroundChangeSets: Boolean = false,
isReconciliationEnabled: Boolean = false,
isReconciliationEnabled: Boolean =
context.lithoConfiguration.componentsConfig.isReconciliationEnabled,
isIncrementalMountEnabled: Boolean = true,
childEquivalenceIncludesCommonProps: Boolean = true,
overlayRenderCount: Boolean = false,
Expand Down

0 comments on commit c8837b0

Please sign in to comment.