meliorence / meliorence/react-native-snap-carousel
useScrollView - Warning: Function components cannot be given refs.
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Issue is here:
https://github.com/meliorence/react-native-snap-carousel/blob/master/src/carousel/Carousel.js#L1357
Change to:
typeof(useScrollView) === 'object' || typeof(useScrollView) === 'function' ? useScrollView : AnimatedScrollView
Any component will be an object so we need to handle that case as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/carousel/Carousel.js around line 1357 and inspect how useScrollView is selected for the ref. Verify the warning scenario and ensure the selection handles both object and function components as described. Done means the warning no longer occurs for the affected component types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100