Skip to content
Snippets Groups Projects
Commit 9aad12f1 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Fixed it again, this time without a react runtime warning

parent f45681da
No related branches found
No related tags found
No related merge requests found
import React from "react";
import React, { useState } from "react";
import "./spaceselect.css";
interface SpaceSelectProps {
......@@ -8,11 +8,16 @@ interface SpaceSelectProps {
}
function SpaceSelect({ onLoadSpace, spaces, spaceId }: SpaceSelectProps) {
const [selected, setSelected] = useState(spaceId);
return (
<div id="spaceselect">
<select
onChange={(event) => onLoadSpace(event.target.value)}
value={spaceId}
onChange={(event) => {
setSelected(event.target.value);
onLoadSpace(event.target.value);
}}
value={selected}
>
{spaces.map((spaceName: string) => (
<option key={spaceName} value={spaceName}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment