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 Counter: ObservableObject { | |
@Published var value: Int = 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
ReactDOM.render( | |
<Provider store = { store }> | |
<BrowserRouter> | |
<BaseLayout> | |
<Switch> | |
<Route exact path = "/" component = { App } /> | |
</Switch> | |
</BaseLayout> | |
</BrowserRouter> | |
</Provider> |
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
// | |
// Array+Extensions.swift | |
// GridSwiftUI | |
// | |
// Created by Mohammad Azam on 6/11/20. | |
// Copyright © 2020 Mohammad Azam. All rights reserved. | |
// | |
import Foundation |
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, useEffect } from 'react'; | |
import './App.css'; | |
import MovieList from './components/MovieList'; | |
function App() { | |
const [movies, setMovies] = useState([]) | |
useEffect(() => { |
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
let animals = ["🐈","🐆","🦌","🦒","🦏","🐄","🐀","🦩","🦜"] | |
extension Array { | |
func chunks(size: Int) -> [ArraySlice<Element>] { | |
var chunks: [ArraySlice<Element>] = [ArraySlice<Element>]() | |
for index in stride(from: 0, to: self.count - 1, by: size) { | |
var chunk = ArraySlice<Element>() |
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 './App.css'; | |
class App extends Component { | |
constructor() { | |
super() | |
// create a state to store name | |
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
import React, { Component } from 'react'; | |
import './App.css'; | |
import Counter from './components/Counter' | |
class App extends Component { | |
constructor() { | |
super() // calls the constructor of the Component | |
console.log(this) // this is App component and it is DEFINED |
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' | |
class Name extends Component { | |
render() { | |
return ( | |
<div> | |
<h1>My name is {this.props.name} and my cat name is {this.props.cat} </h1> | |
</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 from 'react' | |
import { Component } from "react"; | |
import Menu from './components/Menu'; | |
import Post from './components/Post' | |
class App extends Component { | |
// render is used to display html on the screen | |
// JSX = JavaScript and XML |
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
var body: some View { | |
Button(action: { | |
self.isPressed = true | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { | |
self.isPressed = false | |
self.onTap() | |
} |