Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error changing properties of an element through ref #1012

Closed
@vallemar

Description

@vallemar

When I try to animate a view using ref to access the template element the app crashes and closes, but I can't see any errors. Code:

const btnNewTrip = ref()
const btnShowMore = ref()

const showButton = (view: View) => {
    view.animate({
      scale: {
        x: 1,
        y: 1
      },
      duration: 500
    })
}

onMounted(() =>{
  setTimeout(() => {
    console.log(btnNewTrip.value.nativeView)

    showButton(btnNewTrip.value.nativeView)
    showButton(btnShowMore.value.nativeView)
  }, 5000)
})

The console log shows me that it is a view, however the app fails, console.log: JS: StackLayout(46)
By the way, i'm on android

Metadata

Metadata

Assignees

No one assigned

    Labels

    V3Issues related to V3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions