Skip to content

Commit

Permalink
passes props to selector
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomcv committed Jul 19, 2020
1 parent 91ac61a commit 3889fbb
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/MainContent/MainContent.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React, { FunctionComponent } from 'react';
import './MainContent.scss';
import React, { FunctionComponent, useState } from 'react';
import LocationSelector from '../LocationSelector';
import './MainContent.scss';

const MainContent: FunctionComponent = () => {
const [location, setLocation] = useState<string>('lisbon');

const MainContent: FunctionComponent = () => (
<main className="main-content">
<LocationSelector />
</main>
);
return (
<main className="main-content">
<LocationSelector
onChange={(e) => setLocation(e.target.value)}
value={location}
/>
</main>
);
};

export default MainContent;

0 comments on commit 3889fbb

Please sign in to comment.