Last active
August 17, 2019 23:22
-
-
Save esr360/1b8f09db2542e8a15c2a51285591dc59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useContext } from 'react'; | |
const styles = ({ props, state, context, theme }) => ({ | |
... | |
}); | |
const MyComponent = (props) => { | |
const [isActive, setActive] = useState(false); | |
return ( | |
<Module styles={styles} isActive={isActive} onClick={() => setActive(!isActive)}> | |
<Component name='heading' strong>{props.heading}</Component> | |
<Component name='content'>{props.children}</Component> | |
</Module> | |
) | |
} | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment