Home Reference Source Repository

src/components/Submit/index.js

import React from 'react';


/**
 * The `Submit` component is a very minimal form submit
 * button. It sets the type to `submit` and the `value`
 * to the value of the `title` prop. If no title is set,
 * it will set the title to `Subscribe`.
 *
 * @return {ReactElement} - form wrapper markup
 */
function Submit(props) {
  return (
    <input
      type="submit"
      value={props.title ? props.title : 'Subscribe'}
      { ...props }
    />
  );
}

Submit.propTypes = {
  title: React.PropTypes.string,
}

export default Submit;