lithoWorkAroundIgnoreMeasureInResolve

Deprecated

This is a temporary workaround and should not be used in new code. Components should be refactored to avoid measuring during resolve.

Temporary workaround to suppress the "measure in resolve" violation policy.

This method disables the enforcement of the measure-in-resolve policy for this ComponentContext. Normally, measuring a component during the resolve phase is forbidden as it can lead to undefined behaviors and performance issues. When the policy is set to CRASH, Litho will throw an IllegalStateException if a component attempts to measure during resolve.

This workaround should only be used as a temporary solution for legacy components that cannot be immediately migrated to the proper APIs. New code should NOT use this method.

Preferred alternatives:

  • For KComponents: Use the RenderWithConstraints API

  • For the old Layout Specs: Use @OnCreateLayoutWithSizeSpec

  • For other components: Refactor accordingly to avoid measuring during the resolve phase