from component is not re-rendering from after changing props.form

Aperta
#174 9 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@daneformio ci sta già lavorando.

Dal 10/7/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

I am using Form-component with preloaded form json it is not refreshing the form on changing the value of fromProp of the Form tag

code im using :
class App extends Component {

constructor(props) {
super(props);
this.state = { currentUrl: "5c80b71c6bdc0f69544b4e22/", lastValue: {} }
}
formSubmitted = (value) => {
if (value.nextFormId) {
this.setState({ currentUrl: value.nextFormId })
}
}
componentDidMount() {
fetch(this.props.baseURL + this.state.currentUrl).then(this.handleFormIoResponce)
}

handleFormIoResponce = (responce) => {
responce.json().then(value => {
console.log(value)
this.setState({ lastValue: value })
})
}

render() {
let data = ""
return (
<Form form={this.state.lastValue} url={this.props.baseURL + this.state.currentUrl} onSubmit={this.formSubmitted} />
);
}
}

export default App;

Lingua principale
TypeScript
Stelle
371
Fork
309
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di formio/react

Tutte le issue di formio/react

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.