<commit_before>import React from 'react'
import PropTypes from 'prop-types'

import Button, { Wrapper } from 'fyndiq-component-button'
import Dropdown from 'fyndiq-component-dropdown'
import { Arrow } from 'fyndiq-icons'

import Input from './input'
import styles from '../input.css'

class Presets extends React.Component {
  static propTypes = {
    input: PropTypes.element,
    presets: PropTypes.arrayOf(PropTypes.string),
    onChange: PropTypes.func,
  }

  static defaultProps = {
    input: <Input />,
    presets: [],
    onChange: () => {},
  }

  constructor(props) {
    super(props)

    this.state = { value: undefined }

    this.changeValue = this.changeValue.bind(this)
  }
<commit_msg>:bug: Fix issue where input is controlled<commit_after>import React from 'react'
import PropTypes from 'prop-types'

import Button, { Wrapper } from 'fyndiq-component-button'
import Dropdown from 'fyndiq-component-dropdown'
import { Arrow } from 'fyndiq-icons'

import Input from './input'
import styles from '../input.css'

class Presets extends React.Component {
  static propTypes = {
    input: PropTypes.element,
    value: PropTypes.string,
    presets: PropTypes.arrayOf(PropTypes.string),
    onChange: PropTypes.func,
  }

  static defaultProps = {
    input: <Input />,
    value: '',
    presets: [],
    onChange: () => {},
  }

  constructor(props) {
    super(props)

    this.state = { value: this.props.value }

    this.changeValue = this.changeValue.bind(this)
  }

{'fraction_non_alphanumeric': 0.12575655682582382, 'fraction_numerical': 0.0, 'mean_word_length': 3.5365853658536586, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546684', 'n_tokens_mistral': 459, 'n_tokens_neox': 467, 'n_words': 117}