<commit_before>Each example has its own state that you can access at the `state` variable and change with the `setState` function. Default state is `{}`.

	<div>
		<button onClick={() => setState({isOpen: true})}>Open</button>
		<Modal isOpen={state.isOpen}>
        	<h1>Hallo!</h1>
        	<button onClick={() => setState({isOpen: false})}>Close</button>
        </Modal>
	</div>

If you want to set the default state you can do something like that:

	'key' in state || setState({key: 42});<commit_msg>Improve default state example.<commit_after>Each example has its own state that you can access at the `state` variable and change with the `setState` function. Default state is `{}`.

	<div>
		<button onClick={() => setState({isOpen: true})}>Open</button>
		<Modal isOpen={state.isOpen}>
        	<h1>Hallo!</h1>
        	<button onClick={() => setState({isOpen: false})}>Close</button>
        </Modal>
	</div>

If you want to set the default state you can do something like that:

	'count' in state || setState({count: 1});
    <button onClick={() => setState({count: state.count+1})}>{state.count}</button>
{'fraction_non_alphanumeric': 0.1606822262118492, 'fraction_numerical': 0.00718132854578097, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 30, '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': '5309895', 'n_tokens_mistral': 353, 'n_tokens_neox': 347, 'n_words': 118}