Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modify to use 'type' instead of 'interface' when we declare Props typ…
…e definition
  • Loading branch information
sosukesuzuki committed Jan 26, 2019
commit b4a29bbabfa8694085253fba3fdcfa326373ac2e
4 changes: 2 additions & 2 deletions playground/src/context/theme-consumer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';
import ThemeContext from './theme-context';

interface ThemedButtonProps {}
type Props = {};

export default function ToggleThemeButton(props: ThemedButtonProps) {
export default function ToggleThemeButton(props: Props) {
return (
<ThemeContext.Consumer>
{({ theme, toggleTheme }) => <button style={theme} onClick={toggleTheme} {...props} />}
Expand Down
4 changes: 2 additions & 2 deletions playground/src/hooks/use-theme-context.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';
import ThemeContext from '../context/theme-context';

interface ThemedButtonProps {}
type Props = {};

export default function ThemeToggleButton(props: ThemedButtonProps) {
export default function ThemeToggleButton(props: Props) {
const { theme, toggleTheme } = React.useContext(ThemeContext);
return (
<button onClick={toggleTheme} style={theme} >
Expand Down