message: Moved current ref null check into share
diff: @@ -18,18 +18,18 @@ class SharedElement extends React.Component<SharedElementProps, any> {
  this.share(this.props.name)
  }
  share(name: string, data?: any, share = false) {
  + var {current} = this.sharedElementRef;
  var eventData = {bubbles: true, detail: {name, data, share}};
  - this.sharedElementRef.current.dispatchEvent(new CustomEvent('share', eventData));
  + if (current)
  + current.dispatchEvent(new CustomEvent('share', eventData));
  }
  register() {
  var {unshare, name, data} = this.props;
  - if (!unshare) {
  - if (this.sharedElementRef.current)
  + if (!unshare)
  this.share(name, data, true);
  - } else {
  + else
  this.share(name)
  }
  - }
  render() {
  return React.cloneElement(this.props.children, {ref: this.sharedElementRef});
  }
  