by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 08:18
    FieryCod commented #1379
  • Jan 30 2019 10:01
    atif089 commented #1379
  • Jan 30 2019 10:01
    atif089 commented #1379
  • Jan 30 2019 10:01
    atif089 commented #1379
  • Jan 30 2019 04:11
    tclindner opened #1998
  • Jan 28 2019 05:21

    ljharb on master

    [eslint config] [base] [patch] … [eslint config] [patch] extend … Merge pull request #1996 from r… (compare)

  • Jan 28 2019 05:21
    ljharb closed #1996
  • Jan 28 2019 04:50
    ljharb synchronize #1996
  • Jan 27 2019 21:45
    ljharb closed #1997
  • Jan 27 2019 21:45

    ljharb on master

    [editorial] [react] fix typo [eslint config] [*] [deps] upda… (compare)

  • Jan 27 2019 21:39
    ljharb synchronize #1997
  • Jan 27 2019 21:39
    ljharb labeled #1997
  • Jan 27 2019 21:39
    ljharb labeled #1997
  • Jan 26 2019 18:14
    ljharb labeled #1996
  • Jan 26 2019 18:14
    ljharb labeled #1996
  • Jan 26 2019 18:13
    ljharb synchronize #1996
  • Jan 26 2019 18:05
    ljharb commented #1996
  • Jan 26 2019 08:55
    telmen opened #1997
  • Jan 24 2019 19:37
    peteclark3 commented #1689
  • Jan 24 2019 17:25
    ljharb commented #747
Jordan Harband
@ljharb
const { reviews } = this.state, for one
but then also, don't reassign it.
i'm not sure what _id would be for tho
(unless you're using mongo, which you shouldn't be - but that override's the way to do it if so)
Muhammad
@MuhammadJamaluddin
  • If I won't reassign it what should I do?
    I needed the new array returned from map here:
    return (
        <div id="reviews">
          {reviews} <----------
        </div>
      );
  • Yes, i'm using mongoDB (which I shouldn't be?... not sure I get what you mean).
Jordan Harband
@ljharb
you should either make a new variable name, or inline the .map
and i mean you should use a real database, like mysql or similar.
Muhammad
@MuhammadJamaluddin
Gotcha. Thanks for explaining ❤.
Muhammad
@MuhammadJamaluddin
I have a like method in my Reviews component that just uses the event.target object & sends an AJAX request accordingly. I get this eslint error:
Expected 'this' to be used by class method 'like'.eslint(class-methods-use-this)
What's the suggested approach in this case?
jiaweri
@jiaweri
怎么翻墙呢
Muhammad
@MuhammadJamaluddin

Why this is considered an error & how would I add whitespaces in JSX otherwise:

<p>{review.reviewer_name} <time>{review.review_date}</time></p>

the eslint error I mean:
{review.reviewer_name} must be placed on a new lineeslint(react/jsx-one-expression-per-line)

1point7point4
@1point7point4
Consider doing it like so (if this does the same thing, I'm not exactly sure how HTML does its thing with whitespace:
<p>
  {review.reviewer_name}
  <time> {review.review_date}</time>
</p>
Seems to work on chrome
Manuk
@ManukMinasyan

Hello dear developers,
When entering for the first time IE 11 loaded the site correctly you can see it in the first picture.
After refreshing the page we see that the page is not being loaded(see the second picture).
If you can help me, I will be grateful.
Thanks.

Images`

  1. https://imgur.com/C5VRb1B
  2. https://imgur.com/iIeFF2a
aparnatech
@aparnatech
@ManukMinasyan try to empty the event after sending the request
Manuk
@ManukMinasyan
@aparnatech How can I do it?
aparnatech
@aparnatech
@ManukMinasyan event.target.value = ''; set this inside a function atlast where u think the event should be empty so that everytime the event will be empty when u click the function
Manuk
@ManukMinasyan
https://migrolpartnerevent.ch/event2019/ - please take a look to this link, open it with IE 11.
And take a look the console.
Thanks
aparnatech
@aparnatech
@ManukMinasyan i am not getting error in console
Manuk
@ManukMinasyan
I think that I finally could find the solution of the problem.
The problem was connected with version of jquery.
I changed it to latest version.
Thank you guys.
aparnatech
@aparnatech
@ManukMinasyan ok
aparnatech
@aparnatech

@aparnatech
when i trigger the function to convert html to pdf and dowmload it in pdf form the web app restarts everytime ...when i give empty cache and hard reload i can download it without any issue how to correct it
downloadPdf() {

this.Router.navigate(['/test/preview'], { queryParams: { 'test_id': this.test_id, 'branch_id': this.branch_id, 'isprint': true } });

}

Jordan Harband
@ljharb
hi folks - this is not a general JS help channel. It's a channel for the airbnb/javascript repo - which is airbnb's javascript style guide.
Jack carlson
@dpnashsh
Heya, I am using beforeunload function to get alert when user clicks on refresh button on the browser. But when the user clicks on any link on the page it again display the same alert. Is is possible to show alert on click of refresh button but not on any redirection link?
_
1point7point4
@1point7point4
Hi, folks — this is not a general JS help channel. It's a channel for the airbnb/javascript repo - which is airbnb's javascript style guide.
Muhammad
@MuhammadJamaluddin
I have this code in my component:
<label>
  { 'First Name:' }
  <input name="firstName" type="text" onChange={this.handleChange.bind(this)} />
</label>
I get these errors:
  • A form label must be associated with a control.eslint(jsx-a11y/label-has-associated-control)
  • Form label must have ALL of the following types of associated control: nesting, ideslint(jsx-a11y/label-has-for)
I am not sure why... or how to fix it
Jordan Harband
@ljharb
@muhammadjamaluddin you have to BOTH nest, and use for/ID
ie, give the input an id and give the label an htmlFor
there's some engines for which nesting isn't enough
Muhammad
@MuhammadJamaluddin
Yeah, that makes sense. Thanks @ljharb
Richard Sithole
@Sliqric7053
Hi there.
I'm trying to create a regex that will ensure that this string passes 50 000.00
I've tried this ^[0-9]{1,2}([,.][0-9]{1,2})?$ but does not seem to work.
Any ideas how I could achieve this?
1point7point4
@1point7point4
/[\d\s]*.[\d\d]/
Or better yet, /50 000.00/
More use cases, please
Actually you could just do /./ and match any non-empty string
That would definitely match "50 000.00"
Tbh you don’t even need a regex, just do x === "50 000.00"
Abhisek Pattnaik
@abhisekp

hi folks - this is not a general JS help channel. It's a channel for the airbnb/javascript repo - which is airbnb's javascript style guide.

:point_up: April 16, 2019 10:50 PM @Sliqric7053

jsx
@riverspirit
Hey, we're following airbnb styleguide for our project and I wanted to know if its ok to prefix $ sign when storing DOM references (I saw the jQuery section in the styleguide, but we aren't using jQuery)
eg: $body = document.querySelector('body')
I mean, is it acceptable, frowned up on or recommended to put $ sign in front of such variables storing DOM ref
1point7point4
@1point7point4
At a glance, it seems like there's nothing saying you should only prefix with $ for jQuery
I'm not particularly advanced at web development but I think it's a good idea since people go "oh! dom manipulation!" whenever they see a $
jsx
@riverspirit
Yeah, I thought the same but my colleague says he hates it :) So I wanted to get the opinion of others
1point7point4
@1point7point4
You could ask him about using domFoo instead of $foo
What naming conventions does your colleague have in mind?
jsx
@riverspirit
He's for domFoo
1point7point4
@1point7point4
Do you/other colleagues have any particular concerns with doing it that way?
jsx
@riverspirit
Not really