Skip to content

Instantly share code, notes, and snippets.

@wulucxy
Created July 9, 2018 01:28
Show Gist options
  • Save wulucxy/5d23e3bc05bb5caa4b3768caad45bddd to your computer and use it in GitHub Desktop.
Save wulucxy/5d23e3bc05bb5caa4b3768caad45bddd to your computer and use it in GitHub Desktop.
组件引用 #React

组件refs如何获取到dom元素

  • innerRef
export default function LinePath ({innerRef}) {
  return (
    <g>
      <path
        ref={innerRef}
      />
    </g>
  )
}

Usage

<LinePath innerRef={this._setRef}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment