DEV Community

Discussion on: Rethinking JavaScript: The complete elimination and eradication of JavaScript's this.

 
joelnet profile image
JavaScript Joel

The irony is not lost on me. I have opened an issue for this github.com/joelnet/nothis/issues/3

Thanks!

Thread Thread
 
joelnet profile image
JavaScript Joel

Your feedback has been invaluable in the creation of nothis-react. You can now create a Component like this:

import React from 'react'
import NoThis from 'nothis-react'

class Counter extends NoThis.Component {
  state = { count: 0 }

  increment({ setState }) {
    setState(({ count }) => ({ count: count + 1 }))
  }

  render({ increment, state: { count } }) {
    return (
      <div>
        <button onClick={increment}>{count}</button>
      </div>
    )
  }
}

Thanks again!

Thread Thread
 
entrptaher profile image
Md Abu Taher • Edited

It would make more sense with a more expressive usage like this, noMore(this), instead of noThisAll(this), noThatAll(that) and so on.

noMore(fun), noMore(function)...lol...

Thread Thread
 
joelnet profile image
JavaScript Joel

I am the worst at naming. This was actually my first opened issue on github github.com/joelnet/nothis/issues/1 lol

noMore(this) this makes sense when using this, but doesn't if it was noMore(obj), which may happen.