react / react/react-native

TouchableOpacity setOpacityTo is not a function

Open
#29,272 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Component: TouchableOpacity Issue: Author Provided Repro
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Originally reported in expo/expo#9026, I ran into the same problem so I'm re-reporting this here

Description

The setOpacityTo on TouchableOpacity is no longer available.

React Native version:

0.62.2

  Expo CLI 3.20.3 environment info:
    System:
      OS: macOS Mojave 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.20.1 - /var/folders/qt/10542x9d2wbg0x93mmh1xsw00000gn/T/yarn--1593777562592-0.5909086070884821/node
      Yarn: 1.22.4 - /var/folders/qt/10542x9d2wbg0x93mmh1xsw00000gn/T/yarn--1593777562592-0.5909086070884821/yarn
      npm: 6.14.4 - ~/.asdf/installs/nodejs/10.20.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5791312
      Xcode: 11.0/11A420a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^38.0.0 => 38.0.4
      react: 16.11.0 => 16.11.0
      react-dom: 16.11.0 => 16.11.0
      react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2
      react-native-web: ^0.12.0 => 0.12.3
      react-navigation: ^4 => 4.3.9

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Create a reference to TouchableOpacity
  2. Try calling setOpacityTo

Expected Results

Opacity of the element is changed

Actual Results

Fatal crash due to missing method

Snack, code example, screenshot, or link to a repository:

https://snack.expo.io/@zanona/3cb338

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Snack and the TouchableOpacity implementation to reproduce the missing setOpacityTo call on React Native 0.62.2. Confirm that calling the method changes the element opacity without a fatal crash, then verify the reproduction after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.