Skip to content

Bug Report: "Val cannot be reassigned" error regression in v2.0.0 #1167

@HanSeonWoo

Description

@HanSeonWoo

Issue Description

The "Val cannot be reassigned" error that was previously fixed has reappeared in version 2.0.0, suggesting a regression in the codebase.

Environment

  • React Native: 0.74+
  • Library Version: 2.0.0
  • Platform: Android

Issue Timeline

Background

  • Pre-v1.0.0: The "Val cannot be reassigned" error was present in React Native 0.74+ [issue #736]
  • v1.0.0: Issue was resolved with [PR #746]
    android/src/main/java/com/reactnativemenu/MenuViewManagerBase.kt
    view.hitSlopRect = nullview.setHitSlopRect(null)
  • v1.2.0: Further improvements were added, including the setHitSlopRect override method
    ( android/src/main/java/com/reactnativemenu/MenuView.kt - override fun setHitSlopRect )
override fun setHitSlopRect(rect: Rect?) {
    super.setHitSlopRect(rect)
    mHitSlopRect = rect
    updateTouchDelegate()
}
  • v2.0.0: Regression occurred - previous fixes appear to have been reverted

Expected Behavior

The library version 2.0.0 should work without compilation errors on React Native 0.74+, as it did in versions 1.0.0 through 1.2.4.

Actual Behavior

The "Val cannot be reassigned" compilation error has returned, breaking builds for React Native 0.74+ projects.

Reproduction Steps

  1. Use library version 2.0.0
  2. Build project with React Native 0.74+
  3. Encounter "Val cannot be reassigned" compilation error

Possible Solution

Restore the fixes that were implemented in v1.0.0 (PR #746) and the enhancements from v1.2.4, particularly:

  • The setHitSlopRect override method
  • Using view.setHitSlopRect(null) instead of view.hitSlopRect = null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions