christianalfoni / webpack-bin

A webpack code sandbox
http://www.webpackbin.com
MIT License
710 stars 75 forks source link

I seem to have broken webpack-bin! #209

Closed ahuth closed 7 years ago

ahuth commented 7 years ago

First of all, thank you for the really cool project! Unfortunately, I seem to have broken it. And not just for myself, but the site seems to be down now.

I was experimenting with accessible autocompleters in React. After entering the following component, there's now a 500 error when visiting the site:

import React, {Component} from "react"

class Autocompleter extends Component { 
  constructor(props) {
    super(props)
    this.state = {focused: false}
  }

  render() {
    return (
      <label>
        {this.props.label}
        <div class="suggestions-help" role="status" aria-live="polite"></div>
        <input type="text" autocomplete="off" aria-autocomplete="list" />
        <div class="suggestions">
          {this.state.focused &&
            <ul role="listbox">
              {this.props.items.map((item, index) => {
                <li role="option" key={index}>{item}</li>
              })}
            </ul>
          }
        </div>
      </label>
    )
  }
}

When it broke, I was working on the loop creating the individual list items:

<div class="suggestions">
  {this.state.focused &&
    <ul role="listbox">
      {this.props.items.map((item, index) => {
        <li role="option" key={index}>{item}</li>
      })}
    </ul>
  }
</div>