This file contains 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 './App.css'; | |
const App: React.FC = (): JSX.Element => { | |
return ( | |
<div className="App"> | |
Hi | |
</div> | |
); | |
} |
This file contains 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 './App.css'; | |
interface IAppOwnProps { | |
username: string | undefined; | |
userType: 'admin' | 'moderator' | 'user' | 'guest'; | |
} | |
const App: React.FC<IAppOwnProps> = (): JSX.Element => { | |
return ( |
This file contains 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 './App.css'; | |
interface IAppOwnProps { | |
username: string | undefined; | |
userType: 'admin' | 'moderator' | 'user' | 'guest'; | |
} | |
const App: React.FC<IAppOwnProps> = ({userType, username}): JSX.Element => { | |
return ( |
This file contains 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 ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
ReactDOM.render(<App userType='admin' username='h4x0r' />, document.getElementById('root')); | |
serviceWorker.unregister(); |
This file contains 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 [message, setMessage] = useState<string>(''); | |
... | |
<input | |
type='text' | |
placeholder='Enter your message here' | |
value={message} | |
onChange={handleTextChange} | |
/> |
This file contains 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, ChangeEvent } from 'react'; | |
... | |
const handleTextChange = (event: ChangeEvent<HTMLInputElement>): void => { | |
setMessage(event.target.value); | |
}; |
This file contains 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'; | |
interface IUserListOwnProps { | |
} | |
export const UserList: React.FC<IUserListOwnProps> = (): JSX.Element => { | |
return ( | |
<div> | |
UserList |
This file contains 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 ReactDOM from 'react-dom'; | |
import { BrowserRouter, Route, Switch } from 'react-router-dom'; | |
import './index.css'; | |
import App from './App'; | |
import { UserList } from './UserList'; | |
import * as serviceWorker from './serviceWorker'; | |
ReactDOM.render( | |
<BrowserRouter> |
This file contains 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 { Link } from 'react-router-dom'; | |
import styled from 'styled-components'; | |
const CenterContent = styled.div` | |
text-align: center; | |
`; | |
interface IUserListOwnProps { |
This file contains 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 { createStore, applyMiddleware, compose } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import { rootReducer } from './RootReducer'; | |
export const store = createStore(rootReducer, compose( | |
applyMiddleware(thunk), | |
((window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ && (window as any).__REDUX_DEVTOOLS_EXTENSION__()) || compose | |
)); |
OlderNewer