score:0
for referencing this.props.match.params
you need to use react-router
. in case you are already using this library, then you need to wrap the component with withrouter
hoc:
import { withrouter } from 'react-router';
class ajouterfacture extends component {
...
}
export default withrouter(ajouterfacture);
then you can get this.props.match.params.selectprdt
. but do not forget to include this attribute in your react-router path somewhere in router component in a way like this:
<route path='/facture/:selectprdt' component={ajouterfacture}>
and try not to use(it should not work by the way):
let {
clients
} = this.state.clients;
let {
produits
} = this.state.produits;
let {
rowdata
} = this.state.rowdata;
and use these instead:
const {
clients, produits, rowdata
} = this.state;
you can read more about it here
score:1
change:
let {
produits
} = this.state.produits;
for
let {
produits
} = this.state;
Source: stackoverflow.com
Related Query
- How to make react select an params on axios?
- How to get a data after react select using axios and ReactJS?
- How can I make an axios get request wait before rendering my react component
- How to make React Router route with params to be separate from another route
- How to make search in select box using React JS?
- REACT How to make AJAX requests with Redux and Axios (with promise middleware)?
- How to use a custom React hook to make a POST or DELETE request with Axios
- How do I make an axios request using a route parameter from React Router, then update state based on the response?
- How to better way to send optional params in react JS with AXIOS Api call
- How to render multiple dynamic options into select box in React from Axios
- How to make palceholder to move to right of options after values got selected in react select package?
- How to make a react form that submit params to a rails controller?
- How to make setState synchronous in React after axios response
- How to make POST request with axios and React State Hook
- how to make select box in react single selected and mulitple selected?
- How to make React params 1 item
- how to make api call from external file using axios and callbacks and pass param in react
- How to make api in react select
- How can I make React select component auto matically set to accomodate label width?
- how to write one GET api call using axios instance with and without params in React JS
- How to use axios to make requests in react
- How to make axios call one after the other in React
- How to make custom select dropdown in React JS
- How to make select dropdown menu height smaller in React Js?
- How do i make a GET requests from Imgur's API via Axios on my react app
- How do I make it mandatory to select at least two options using the React Multiselect component?
- How to make dynamic state with select in react
- How can I make use of Error boundaries in functional React components?
- How to make React CSS import component-scoped?
- How to allow input type=file to select the same file in react component
More Query from same tag
- How can I manage query parameters that are not always filled?
- JavaScript find(), what is the difference of passing {} and without {}?
- React: fetch updated data from server without refresh
- Pass custom date object from jalali-moment library to time.Date option
- How to get the block unique ID inside edit and save functions on registerBlockType
- Fetch url to React component
- getting innerHTML from a div after changes through contentEditable in React
- How to calculate the speed of an animation in seconds based on current pageYOffset and previousPageYOffset?
- React not updating component props?
- What are the aspects of JS binding?
- Split string into separate line according to container size
- how to obtain scroll to view inside a div
- Formik with Yup
- States and Router paths
- npm ERR! FetchError: request to http://registry.npmjs.org/webpack-dev-server failed, reason: connect ECONNREFUSED 127.0.0.1:8000
- Sequelize insert into join table many-to-many
- I am stuck on this React Testdome question
- Chart.js Doughnut Chart Rendering Wrong
- React-Table: Get selectedRowIds in parent component
- on button return id to show specific json react js
- Infinity Loop with promises and state variables in ReactJs
- How to retrieve a React property from an event object
- How to execute OS paste action via electron
- How to configure Electron, Webpack, Babel, React, and JSX?
- Why HTML SVG hexagon onClick "hitbox" being rectangular?
- How can I refer to another react component?
- Both Pages are Displaying its content on a single page - React
- VictoryChart not filling entire div
- How to access an image link inside an object and show it using react componenets
- Making SVG Responsive in React