Skip to content

Tag: reactjs

Inline eslint comment in JSX

I’m getting an error (eslint): Line 199 exceeds maximum line length of 120. (max-len) Why doesn’t this inline comment work? Answer eslint-disable-line and eslint-disable-next-line are only in inline comments. There is currently an open issue for this in eslint So you would have to write it as the …

Auto update when onSubmit with ReactJS

I have an app that post/get data from json. However when I add a comment, the latest comment that I added did not append automatically, but it will show if i refresh or reinstate the values. Here’s the code that handles my comments And this is the component that uses those functions Answer It is because…

Reactjs with Pokeapi

I have an app that searches the name of the pokemon reads the data eg. name, height, weight. Now when it comes to the abilities I can’t get the value of the name of the ability. here’s my app.js Answer Abilities has this structure. You can check this by logging this.state.abilities It’s just…

Using Charts.js with react

I am using React and want to tie it in with Chart.js. The graph below works, but I am not sure how to make a Graph component in React. My Chart.js code looks like the following: I then tried to incorporate this into React. Unfortunately, this didn’t work. My code attempt can be seen here.This is kind of…

Swipe effect in react js

I’m trying to create a swipe event using React. I do not want to use any external component or jquery. The css is something like : In the react component I’m trying to do something like : How can I recognize swipe event? If I in my example instead of onSwipe add onClick it works, but how can I mak…