My variables are undefined, none of them, why not? What did I define incorrectly? Do I need to change the whole method or can I fix some things based on what I wrote?
I put here only the relevant component
Thanks!
Addroom.js
import React, { Component } from 'react'
export default class Addroom extends Component {
constructor(props) {
super(props)
this.state = {
category,
setCategory,
roomTypes:[kitchen, bathroom, bedroom],
yourRoom
}}
getSelectedRoomInCategory = () => {
return roomTypes.filter(
(yourRoom) => yourRoom.category === category
);
};
render() {
return (
<div>
<h1>Select Room Type!</h1>
<select onChange={(e) => setCategory(e.target.value)}>
<option value={kitchen}>{kitchen}</option>
<option value={bathroom}>{bathroom}</option>
<option value={bedroom}>{bedroom}</option>
</select>
</div>
)
}
}