<commit_before>import React, { Component } from 'react';
import { storiesOf } from '@storybook/react';

import { Box, Grommet, RadioButtonGroup } from 'grommet';
import { grommet } from 'grommet/themes';

class SimpleRadioButtonGroup extends Component {
  constructor(props) {
    super(props);
    this.state = { value: props.value };
  }

  onChange = event => this.setState({ value: event.target.value });

  render() {
    const { value } = this.state;
    return (
      <Grommet theme={grommet}>
        <Box align="center" pad="large">
          <RadioButtonGroup
            name="radio"
            options={[
              { label: 'Choice 1', value: 'c1' },
              { label: 'Choice 2', value: 'c2' },
              { label: 'Choice 3', value: 'c3' },
            ]}
            value={value}
            onChange={this.onChange}
            {...this.props}
          />
        </Box>
      </Grommet>
    );
  }
}

storiesOf('RadioButtonGroup', module).add('Simple', () => (
  <SimpleRadioButtonGroup />
));<commit_msg>Convert RadioButtonGroup story to hooks (#3400)<commit_after>import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';

import { Box, Grommet, RadioButtonGroup } from 'grommet';
import { grommet } from 'grommet/themes';

const SimpleRadioButtonGroup = ({ value: initialValue, ...props }) => {
  const [value, setValue] = useState(initialValue);

  return (
    <Grommet theme={grommet}>
      <Box align="center" pad="large">
        <RadioButtonGroup
          name="radio"
          options={[
            { label: 'Choice 1', value: 'c1' },
            { label: 'Choice 2', value: 'c2' },
            { label: 'Choice 3', value: 'c3' },
          ]}
          value={value}
          onChange={event => setValue(event.target.value)}
          {...props}
        />
      </Box>
    </Grommet>
  );
};

storiesOf('RadioButtonGroup', module).add('Simple', () => (
  <SimpleRadioButtonGroup />
));
{'fraction_non_alphanumeric': 0.16191446028513237, 'fraction_numerical': 0.008146639511201629, 'mean_word_length': 2.393782383419689, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 20, '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': '256450', 'n_tokens_mistral': 609, 'n_tokens_neox': 597, 'n_words': 135}