Skip to content

Commit

Permalink
rect concepts - componenta
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadriada committed Feb 8, 2023
1 parent 56c552f commit 391c86c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 58 deletions.
37 changes: 2 additions & 35 deletions examples/react-concepts/src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
background-color: bisque;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
font-size: 1.5rem;
}
35 changes: 18 additions & 17 deletions examples/react-concepts/src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import logo from './logo.svg';
import './App.css';
import React, { useState } from "react";
import Input from "./components/class/Input";
import "./App.css";

function App() {
const [state, setState] = useState("default");



return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div
className="App"
style={{
color: "red",
textAlign: "center",
}}
>


<Input />
<h1>{state}</h1>
</div>
);
}
Expand Down
18 changes: 18 additions & 0 deletions examples/react-concepts/src/components/class/Input.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { Component } from "react";

class Input extends Component {
constructor() {}
//state = "default";

/*function handleChange(event) {
console.log(event.target.value);
//setState(event.target.value);
//console.log("state", state);
}*/

render() {
return <input value={this.state} type="text" onChange={handleChange} />;
}
}

export default Input;
12 changes: 6 additions & 6 deletions examples/react-concepts/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
Expand Down

0 comments on commit 391c86c

Please sign in to comment.