ao.reactiflux.com/m/1354813585452433690

Preview meta tags from the ao.reactiflux.com website.

Linked Hostnames

4

Thumbnail

Search Engine Appearance

Google

https://ao.reactiflux.com/m/1354813585452433690

snowberb – 13-45 Mar 27 - Reactiflux

I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```



Bing

snowberb – 13-45 Mar 27 - Reactiflux

https://ao.reactiflux.com/m/1354813585452433690

I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```



DuckDuckGo

https://ao.reactiflux.com/m/1354813585452433690

snowberb – 13-45 Mar 27 - Reactiflux

I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```

  • General Meta Tags

    6
    • title
      snowberb – 13-45 Mar 27 - Reactiflux
    • charset
      utf-8
    • viewport
      width=device-width, initial-scale=1
    • next-size-adjust
    • description
      I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```
  • Open Graph Meta Tags

    3
    • og:title
      snowberb – 13-45 Mar 27 - Reactiflux
    • og:description
      I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```
    • og:image
      https://ao.reactiflux.com/og/post?id=1354813585452433690
  • Twitter Meta Tags

    4
    • twitter:card
      summary_large_image
    • twitter:title
      snowberb – 13-45 Mar 27 - Reactiflux
    • twitter:description
      I have an array of objects which consists of information about the properties of a building. This array can have just 4 or more than 500 properties depending on the apartment complex. Based on this array, and the information of each property, I have to render some inputs which are Block, Stair, Floor and Door. In that said order, I have to populate the next input only with the matching data based on what the user selected. For example, if the Block 3 only has stairs E, F, G, only these options are going to show up in the Stairs input. And its the same for the next ones, if the Stair E has only floors 5 and 6, only these will show up on the Floor input. The problem im facing with my code now, is that Blocks, Stairs and Floors are optional and may not be available. I do not know how I can rearrange my code so that if the property "block" or "stair" or "floor" is missing, the filter automatically works with the next available piece of information. This is what I have: ```js const blocks = [...new Set(properties.map(({ block }) => block))].map(block => ({ id: block, value: block, label: block })); const stairs = [...new Set(properties.filter(({ block }) => block === selectedBlock).map(({ stair }) => stair))].map(stair => ({ id: stair, value: stair, label: stair, })); const floors = [ ...new Set(properties.filter(({ block, stair }) => block === selectedBlock && stair === selectedStair).map(({ floor }) => floor)), ].map(floor => ({ id: floor, value: floor, label: floor })); const doors = [ ...new Set( properties .filter(({ block, stair, floor }) => block === selectedBlock && stair === selectedStair && floor === selectedFloor) .map(({ door }) => door), ), ].map(door => ({ id: door, value: door, label: door })); ```
    • twitter:image
      https://ao.reactiflux.com/og/post?id=1354813585452433690
  • Link Tags

    14
    • canonical
      https://ao.reactiflux.com/m/1354813585452433690
    • icon
      https://cdn.answeroverflow.com/102860784329052160/a_4fbc177539c73d884393602c62be8a38/icon.png
    • preload
      https://www.answeroverflow.com/_next/static/media/4f05ba3a6752a328-s.p.woff2
    • preload
      https://www.answeroverflow.com/_next/static/media/9cf9c6e84ed13b5e-s.p.woff2
    • preload
      /discord/1.png

Links

8