<commit_before>import React, {Component, PropTypes} from 'react';
import _ from 'lodash';
import DefaultTheme from './themes/bootstrap3';
import {reduxForm} from 'redux-form';
import renderFields from './renderFields';

class Liform extends React.Component {
    constructor(props) {
        super(props);
        this.state = {theme: props.theme || DefaultTheme}
    }

    getFields() {
        return _.keys(this.props.schema.properties);
    }


    render() {
        var theme = this.state.theme;
        var schema = this.props.schema;
        class BaseForm extends React.Component {
            constructor(props) {
                super(props);
            }
            render() {
                return (
                <form onSubmit={this.props.handleSubmit}>
                    {renderFields(this.props.fields, schema, theme)}
                    <button type="submit">Submit
                    </button>
                </form>);
            }
        }
        var FinalForm = reduxForm({
            form: this.props.schema.title || 'form',
            fields: this.getFields(),
        })(BaseForm);
        return (<FinalForm renderFields={renderFields.bind(this)} onSubmit={this.props.handleSubmit}/>);
    }
}

Liform.propTypes = {
    schema: PropTypes.object.isRequired,
    //    handleSubmit: PropTypes.func.isRequired,
}

export default Liform;<commit_msg>Better export and propagation for easier reuse<commit_after>import React, {Component, PropTypes} from 'react';
import _ from 'lodash';
import DefaultTheme from './themes/bootstrap3';
import {reduxForm} from 'redux-form';
import renderFields from './renderFields';

class Liform extends React.Component {
    constructor(props) {
        super(props);
        this.state = {theme: props.theme || DefaultTheme}
    }

    getFields() {
        return _.keys(this.props.schema.properties);
    }


    render() {
        var theme = this.state.theme;
        var schema = this.props.schema;
        class BaseForm extends React.Component {
            constructor(props) {
                super(props);
            }
            render() {
                return (
                <form onSubmit={this.props.handleSubmit}>
                    {renderFields(this.props.fields, schema, theme)}
                    <button type="submit">Submit
                    </button>
                </form>);
            }
        }
        var FinalForm = reduxForm({
            form: this.props.schema.title || 'form',
            fields: this.getFields(),
        })(BaseForm);
        return (<FinalForm renderFields={renderFields.bind(this)} {...this.props} onSubmit={this.props.handleSubmit}/>);
    }
}

Liform.propTypes = {
    schema: PropTypes.object.isRequired,
    //    handleSubmit: PropTypes.func.isRequired,
}

export default Liform;

export { renderFields };
{'fraction_non_alphanumeric': 0.12118018967334036, 'fraction_numerical': 0.0007024938531787847, 'mean_word_length': 2.03948772678762, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5780361', 'n_tokens_mistral': 773, 'n_tokens_neox': 746, 'n_words': 166}