Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
Intentando pasar accesorios (este accesorio es de otro componente) de un componente a otro componente

Tengo un componente comment.js y contiene this.props.description debajo de <td> . Quiero pasar esto ( this.props.description ) a la página issueDetails.js . Pero traté de establecer esta description en this.state . Entonces estoy pasando pero todavía no trabajo. Solo quiero pasar {this.props.description} .

 import React from "react"; import { Link } from "react-router-dom"; import IssuesDetails from "./issuesDetails"; export default class Comment extends React.Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); this.state = { href1: "", pass: "" }; } componentDidMount(){ this.setState({pass:this.props.description}); } handleClick() { var result = window.confirm("Are you sure you want to view the details?"); if (result === true) { this.setState({href1:"/details"}); } else { this.setState({href1:""}); } return( <> {/* trying to pass here but failed */} <IssuesDetails pass1={this.state.pass} /> </> ) } render() { return ( <> {/* href={`/issues/details`} */} <tr> <td> <a href={`/issues${this.state.href1}`} onClick={this.handleClick}> {this.props.description} </a> </td> <td>{this.props.severity}</td> <td>{this.props.children}</td> </tr> {/* <div> </div> */} </> ); } }
 import React, { Component } from 'react' export default class IssuesDetails extends Component { constructor(props){ super(props); } render() { return ( <> <h1>Isssue Details</h1> <h2>Details: - {this.props.pass1}</h2></> ) } }
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!