Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element ref was specified as a string (tabContainer) but no owner was set. #1195

Open
2 tasks
Rajput-Siddhi opened this issue Apr 13, 2023 · 3 comments
Open
2 tasks

Comments

@Rajput-Siddhi
Copy link

While using react-native-scrollable-tab-view in my project getting error:
Error: Element ref was specified as a string (tabContainer) but no owner was set.

Steps to Reproduce

  1. Install react-native-scrollable-tab-view.
  2. Use ScrollableTabView, ScrollableTabBar from react-native-scrollable-tab-view as follows:
    <ScrollableTabView
    initialPage={0}
    prerenderingSiblingsNumber={Infinity}
    tabBarInactiveTextColor="gray"
    tabBarActiveTextColor="#00BCE0"
    renderTabBar={() => }

<Tab1
tabLabel="Tab 1"
navigation={this.props.navigation}

<Tab2
tabLabel="Tab 1"
navigation={this.props.navigation}

Expected Behavior

2 Tabs should be visible on screen named Tab1 and Tab2

Actual Behavior

App crashes with following error:

Error: Element ref was specified as a string (tabContainer) but no owner was set. This could happen for one of the following reasons:

  1. You may be adding a ref to a function component
  2. You may be adding a ref to a component that was not created inside a component's render method
  3. You have multiple copies of React loaded
@billxie1988
Copy link

replace the ref={'tabContainer'}
with ref={ref => (this.tabContainer = ref)}

@111Tashmo
Copy link

same issue, any update?

@111Tashmo
Copy link

this helps #1148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants