您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AbstractBlankPage.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import PropTypes from 'prop-types';
  2. import { Component } from 'react';
  3. import { destroyLocalTracks } from '../../base/tracks';
  4. /**
  5. * A React <tt>Component</tt> which represents a blank page. Destroys the local
  6. * tracks upon mounting since no media is desired when this component utilized.
  7. * Renders nothing.
  8. */
  9. export default class AbstractBlankPage extends Component {
  10. /**
  11. * <tt>AbstractBlankPage</tt> React <tt>Component</tt>'s prop types.
  12. *
  13. * @static
  14. */
  15. static propTypes = {
  16. dispatch: PropTypes.func
  17. };
  18. /**
  19. * Destroys the local tracks (if any) since no media is desired when this
  20. * component is rendered.
  21. *
  22. * @inheritdoc
  23. * @returns {void}
  24. */
  25. componentWillMount() {
  26. this.props.dispatch(destroyLocalTracks());
  27. }
  28. /**
  29. * Implements React's {@link Component#render()}. Returns null because the
  30. * purpose of this component is to destroy the local tracks and render
  31. * nothing.
  32. *
  33. * @inheritdoc
  34. * @returns {null}
  35. */
  36. render() {
  37. return null;
  38. }
  39. }