Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: the-road-to-learn-react/hacker-stories
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2025_props
Choose a base ref
...
head repository: the-road-to-learn-react/hacker-stories
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2025_state
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 30, 2025

  1. fix(2025_state): 2025_state

    rwieruch committed Jan 30, 2025
    Copy the full SHA
    3a0e6a8 View commit details
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/App.jsx
13 changes: 9 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as React from 'react';

const App = () => {
const stories = [
{
@@ -32,17 +34,20 @@ const App = () => {
};

const Search = () => {
const [searchTerm, setSearchTerm] = React.useState('');

const handleChange = (event) => {
// synthetic event
console.log(event);
// value of target (here: input HTML element)
console.log(event.target.value);
setSearchTerm(event.target.value);
};

return (
<div>
<label htmlFor="search">Search: </label>
<input id="search" type="text" onChange={handleChange} />

<p>
Searching for <strong>{searchTerm}</strong>.
</p>
</div>
);
};