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 from 'react' | |
| export default function App(props){ | |
| const name = 'Reactish'; | |
| const setName = ?? | |
| function handleNameChange(e){ | |
| setName(e.target.value) | |
| } |
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 from "react"; | |
| export default class App extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| name: "Reactish" | |
| }; | |
| this.handleNameChange = this.handleNameChange.bind(this); |
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
| function Counter() { | |
| const [count, setCount] = useState(0); | |
| useEffect(() => { | |
| setTimeout(() => { | |
| console.log(`You clicked ${count} times`); | |
| }, 3000); | |
| }); | |
| return ( |
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
| // İlk render | |
| function Counter() { | |
| // ... | |
| useEffect( | |
| // Effect ilk render'den | |
| () => { | |
| document.title = `You clicked ${0} times`; | |
| } | |
| ); | |
| // ... |
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
| function Counter() { | |
| const [count, setCount] = useState(0); | |
| useEffect(() => { | |
| document.title = `You clicked ${count} times`; | |
| }); | |
| return ( | |
| <div> | |
| <p>You clicked {count} times</p> |
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
| // İlk render | |
| function Counter() { | |
| const count = 0; // useState()'den dönen | |
| // ... | |
| function handleAlertClick() { | |
| setTimeout(() => { | |
| alert('You clicked on: ' + count); | |
| }, 3000); | |
| } | |
| // ... |
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
| function Counter() { | |
| const [count, setCount] = useState(0); | |
| function handleAlertClick() { | |
| setTimeout(() => { | |
| alert('You clicked on: ' + count); | |
| }, 3000); | |
| } | |
| return ( |
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
| // ilk render | |
| function Counter() { | |
| const count = 0; // useState()'den dönen | |
| // .. | |
| <p>You clicked {count} times</p> | |
| // .. | |
| } | |
| // Click'ten sonra fonksiyonumuz tekrar çağırılır | |
| function Counter() { |
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 count = 42; | |
| <p>You clicked {count} times</p> |
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
| function Counter() { | |
| const [count, setCount] = useState(0); | |
| return ( | |
| <div> | |
| <p>You clicked {count} times</p> | |
| <button onClick={() => setCount(count + 1)}> | |
| Click me | |
| </button> | |
| </div> |
NewerOlder