score:1
Accepted answer
the answer is yes you access props only inside component. try to do it like this
const setoptions (props) = {
const options = {
chart: {
type: 'line'
},
title: {
text: 'price history'
},
xaxis: {
title: {
text: 'date of change'
},
categories: [...props.time]
},
yaxis: {
title: {
text: 'price in $'
}
},
series: [
{
name: 'price',
data: [...props.price]
}
]
}
}
score:1
change last two lines to,
export default connect(mapstatetoprops)(pricehistory);
to connect component we have to pass our component as the function parameter to the connect api.
Source: stackoverflow.com
Related Query
- Update part of object (nested) in redux store using immer and es6 in a normalized data
- Get API Json data in object and array format using redux and reactjs
- Using redux data in JS object
- How can I pass data to an object using React Hooks and Redux
- react native post form data with object and file in it using axios
- how to save array object data in redux store
- Fetch data in parallel using Redux Saga
- How can I cache data that I already requested and access it from the store using React and Redux Toolkit
- How to generate a unique id automatically for the data that is posted to an API server using axios library in redux
- What's the recommended place to fetch user data using Redux when app starts?
- How do I display data from a JSON object using ReactJS?
- Mapping Object Array Data in Redux
- Redux State Using Reselect To Derive Related Data
- How to post data to an API server using axios library in redux
- How to retrieve data from Redux store using functional components and avoiding useSelector & useDispatch
- How do I correctly add data from multiple endpoints called inside useEffect to the state object using React Hooks and Context API?
- React Redux re-fetch data using state and state change
- How to Assign react redux state api get data using axios
- How to load object from route parameter using redux
- Data from the object doesn't convert when using JSON.stringify
- Need browsers refresh to get data displayed after user Login in react using redux
- Redux normalised data using separate reducers
- How to set/access data object correctly using React with a Firebase database?
- Share API data with other components by using React Hook, NO REDUX
- A state is undefined object when using React and Redux , Router
- Replacing an object in an object array in Redux Store using Javascript/Lodash
- Updating property of nested object in Redux using action
- How can I filter data using Redux but keeping the old state?
- How to extract data from javascript object using map() in javascript?
- Pass Data Using Redux in REACTJS
More Query from same tag
- componentDidUpdate isn't recognising state change
- View isn't rerendering, but my Redux Store updates properly
- Value not getting passed from child to parent component in React
- min-height property with nested react components?
- call instance method from higher order component in react
- canvas.drawImage does not work in React?
- Wait for get request response before continuing with a post request in axios
- React button does not show up
- Why socket.io does not work further on react components after I remove all listeners in another component?
- Having a tree structure on both sides of the Transfer component
- How to combine theme.breakpoints on react?
- How i can create the function for the countdown in React native?
- Getting values from material-ui Button in React
- Cannot read property '__reactAutoBindMap' of undefined
- Trying to upload an image using Firebase storage and Firestore Database - encountering a map error
- ReactJS and axios, issues accessing nested objects from JSON response
- React Router - useNavigate.navigate not working when I manually enter the path
- How to fix missing dependency warning when using useEffect React Hook
- How to get VSCode to show TypeScript errors for files *not* open in the editor?
- How do I add a definition for a React Component imported from a library
- Firebase deploy to another site
- Lifting up the state to the main component in React application using hooks
- Is the following form of functional components valid?
- Cloning nodes and appending to separate Layers in React-Konva
- React - differentiating between dynamically generated inputs on a form
- Shuffling React state array containing React components
- ReactJS, it won't rerender child component on state change
- Type 'Dispatch<SetStateAction<any[]>>' is not assignable to type '(values?: string) => void'
- Why does this error stop the rendering of my react app?
- webpack babel loader fails to compile jsx