score:0

Accepted answer

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;


Related Query

More Query from same tag