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
store.dispatch({ | |
type: 'CHANGE_THEME', | |
payload: localStorage.getItem('theme') || 'dark' | |
}); |
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
<ShoppingCart | |
direction='vertical' | |
items={[ | |
{ name: 'Eggs' }, | |
{ name: 'Ham' } | |
]} | |
onItemClick={this.handleItemClick} | |
/> |
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
<ShoppingCart direction='vertical' onClick={this.handleItemClick}> | |
<ShoppingCartItem>Eggs</ShoppingCartItem> | |
<ShoppingCartItem>Ham</ShoppingCartItem> | |
</ShoppingCart> |
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
<ShoppingCart direction='vertical' onClick={this.handleItemClick}> | |
<ShoppingCartItem>Eggs</ShoppingCartItem> | |
<ShoppingCartItem onClick={this.otherClickHandler}> | |
Ham | |
</ShoppingCartItem> | |
</ShoppingCart> |
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
<ShoppingCart direction='vertical' onClick={this.handleItemClick}> | |
<ShoppingCartItem>Eggs</ShoppingCartItem> | |
<ShoppingCartItem>Ham</ShoppingCartItem> | |
<ShoppingCartExpandableItem extendedDetails='Details to show when clicked'> | |
Bread | |
</ShoppingCartExpandableItem> | |
</ShoppingCart> |
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
let myString = 'hello world'; // implicitly types variable as type 'string' | |
myString = 52; | |
//$ error: Type '52' is not assignable to type 'string' |