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
| class MyComponent extends Component { | |
| componentDidMount() { | |
| // verileri çekmek için api listener ekledik | |
| // mouse hareketleri için event listener ekledik. | |
| } | |
| componentWillUnmount() { | |
| // api listener'ı kaldır | |
| // event listener'ı kaldır | |
| } |
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, { useState } from 'react'; | |
| function Counter() { | |
| const [count, setCount] = useState(0); | |
| return ( | |
| <div> | |
| <p>{count}</p> | |
| <button onClick={() => setCount(count + 1)}> | |
| Click me |
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'; | |
| class Counter extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| count: 0, | |
| }; | |
| } |
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' | |
| const Row = props => { | |
| return( | |
| <div> | |
| {props.children} | |
| </div> | |
| ) | |
| } |
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, { Component } from 'react'; | |
| import Row from './Row' | |
| class App extends Component { | |
| constructor(props){ | |
| super(props) | |
| this.state = { | |
| name: 'Ebru', | |
| } | |
| // 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
| this.setState ( { | |
| clicked: true, | |
| }, () => { | |
| console.log('the state is now', this.state) |
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 formatCurrency = function( | |
| currencySymbol, | |
| decimalSeparator ) { | |
| return function( value ) { | |
| const wholePart = Math.trunc( value / 100 ); | |
| let fractionalPart = value % 100; | |
| if ( fractionalPart < 10 ) { | |
| fractionalPart = '0' + fractionalPart; | |
| } | |
| return `${currencySymbol}${wholePart}${decimalSeparator}${fractionalPart}`; |
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
| handleScanner = () => { | |
| const formData = new FormData(); | |
| formData.append("file", this.state.files[0]); | |
| formData.append("tags", 'text_detection'); | |
| formData.append("upload_preset", {UPLOAD_PRESENT_ID}); | |
| formData.append("api_key", API_KEY); | |
| formData.append("timestamp", (Date.now() / 1000) | 0); | |
| axios.post( | |
| "https://api.cloudinary.com/v1_1/{YOUR_USERNAME}/image/upload"", |
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
| <FilePond | |
| onupdatefiles={(fileItems) => { | |
| this.setState({ | |
| files: fileItems.map(fileItem => fileItem.file) | |
| }); | |
| }} | |
| onDrop={this.handleUploadImages}/> |
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
| sudo dpkg -i <package_name>.deb |