This file contains hidden or 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
| <InputContainer ...props> | |
| <InputLabel ...props /> | |
| <InputLeftAddon ...props /> | |
| <InputControl ...props /> | |
| <InputRightAddon ...props /> | |
| </InputContainer> |
This file contains hidden or 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, { FC } from "react"; | |
| interface InputProps { | |
| inputRef: React.RefObject< | |
| HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | |
| >; | |
| className?: string; | |
| containerClassName?: string; | |
| formGroupClassName?: string; |
This file contains hidden or 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, { FC } from "react"; | |
| interface InputProps { | |
| value: string; | |
| onChange: React.ChangeEventHandler<HTMLInputElement>; | |
| className?: string; | |
| label: string; | |
| } | |
| const Input: FC<InputProps> = ({ label, ...props }) => { |
This file contains hidden or 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
| interface CatFactData { | |
| facts: string[]; | |
| color: string; | |
| link: string; | |
| } | |
| const CatFact = ({ facts }: CatFactData) => { | |
| return ( | |
| <ul> | |
| {facts.map((fact) => ( |
This file contains hidden or 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
| interface CatFact { | |
| facts: string[]; | |
| color: string; | |
| } | |
| const CatFactA = ({ facts, color }: CatFact) => { | |
| return ( | |
| <> | |
| {facts.map((fact, index) => ( | |
| <p style={{ color }}> |
This file contains hidden or 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 { useEffect, useState } from "react"; | |
| import RequestCatFactService from "./RequestCatFactService"; | |
| export default function App() { | |
| const [fact, setFact] = useState(""); | |
| useEffect(() => { | |
| RequestCatFactService().then((res) => { | |
| setFact(res); | |
| }); |
This file contains hidden or 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 { useEffect, useState } from "react"; | |
| import axios from "axios"; | |
| export default function App() { | |
| const [fact, setFact] = useState(""); | |
| useEffect(() => { | |
| axios.get("https://cat-fact-herokuapp.com/facts").then((res) => { | |
| setFact(res.data[0].text); | |
| }); |
This file contains hidden or 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
| const path = require('path'); | |
| module.exports = { | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.css$/, | |
| use: [ | |
| { | |
| loader: 'postcss-loader', |