Skip to content

Instantly share code, notes, and snippets.

@hskang9
Created April 29, 2019 09:37
Show Gist options
  • Save hskang9/af89c24f7c468415d485c614107bfa82 to your computer and use it in GitHub Desktop.
Save hskang9/af89c24f7c468415d485c614107bfa82 to your computer and use it in GitHub Desktop.
Hover component
export class Hover extends React.Component<Props> {
// Set default properties
static defaultProps = {
text: "Hello World!",
color: "black",
}
// Items shown in property panel
static propertyControls: PropertyControls = {
text: { type: ControlType.String, title: "Text" },
color: { type: ControlType.Color, title: "Background Color" },
}
render() {
return <HoverContainer color={this.props.color}>
<p>{this.props.text}</p>
</HoverContainer>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment