Skip to content

Commit

Permalink
fix: CTabPane: fix passing innerRef
Browse files Browse the repository at this point in the history
  • Loading branch information
woothu committed Jul 17, 2020
1 parent eba59c2 commit 7fa5601
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tabs/CTabPane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useContext, createRef, useEffect } from 'react'
import React, { useState, useContext, useRef, useEffect } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import CFade from '../fade/CFade'
Expand All @@ -25,8 +25,9 @@ const CTabPane = props => {
const context = useContext(Context)
const fade = useContext(FadeContext)
const act = (context || {}).active
const ref = createRef()
innerRef && innerRef(ref)
const ref = typeof innerRef === 'object' ? innerRef : useRef()
typeof innerRef === 'function' && innerRef(ref)

const [isActive, setIsActive] = useState(active)

useEffect(() => {
Expand Down

0 comments on commit 7fa5601

Please sign in to comment.