We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6841897 commit e85280fCopy full SHA for e85280f
src/02-components/04-typing-components.problem.tsx
@@ -1,6 +1,13 @@
1
import React from "react";
2
3
-export const Button = (props: unknown) => {
+// Initially I just declared className :string directly
4
+// Refactored to this approach as I like abstraction and it's more readable:
5
+
6
+export interface ButtonProps {
7
+ className: string;
8
+}
9
10
+export const Button = (props: ButtonProps) => {
11
return <button className={props.className}></button>;
12
};
13
0 commit comments