Skip to content

Tag: reactjs

ES6: fire React function

This is the code: What I am trying to do is to fire the updateNews code from render: But keep getting this error: Uncaught Error: this.updateNews is not a function Answer You were not calling the functuion Note: You do need to bind because you use arrow function.

React – carousel

I’m creating my own carousel and I want to add circles navigation on the bottom of slider. I am fetching data from mongoDb (3 pictures) and load them in App component and passing via props to Carousel component. I want to map trough array and set index to data-slider property and later read this with e.…

Displaying images from fetch API call Node/React

Im trying display images im fetching from API btw url is defined Gallery.js with or without the regex /[blob:]{5}/gi it is only displaying the alt prop and not the image. The image is received and the get call is successful but the objectURL url is not working. Any help? Answer const {image} = this.props.phot…

Connecting actions to store outside a component?

So let’s suppose I have a store, with a redux-thunk middleware in it. I created the store and exported it like this: I can now access it anywhere in my app. But what if I want to dispatch an action from anywhere? I have them declared e.g. in myAction.js: Now I can import them and connect to my store/com…

Adding a greeting to a React App based on the time of day

I’m just starting out with React and I am trying to implement a greeting in which the user gets a different greeting based on the time of day. I’m familiar with the JavaScript function to do this, I’m just not sure how to directly insert it into my code. This is my navbar component that I ha…