vigour-io / builder-boy

👲🏽 Build and watch es modules FAST 👲🏽
6 stars 1 forks source link

JSX: Event handler parameters are messed up with global variables #70

Open x-cray opened 7 years ago

x-cray commented 7 years ago

Doesn't work (state handler parameter name is colliding with outer state parameter):

const Test = state => {
  return <a on={{
    click: ({ state }, stamp) => state.set()
  }}></a>
}

If one renames outer or inner parameter it starts compiling:

const Test = state => {
  return <a on={{
    click: (e, stamp) => e.state.set()
  }}></a>
}

But even with the same name they are completely different values which should not be treated as the single param.