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

88
Views
Change prop value

I am working on an old app which used to have the following index.tsx

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { MyApp, MyAppProps } from './components';

function init(element: HTMLElement, options: MyAppProps) {
  ReactDOM.render(<MyApp {...options} />, element);
}

The object MyAppProps is an interface with few defaults. Because I want to be able to change one of these defaults based on the URLParams, I thought to introduce a simple

const queryParams = new URLSearchParams(window.location.search);  
const myKey = queryParams.get('myKey')

and then pass the myKey with a line like this

let MyAppProps.key = myKey

but it does not work. I cannot figure out how to correctly construct this piece of code. It seems I should create an object of the same type of the interface so that I can manipulate, but all my tests are failing.

about 4 years ago · Juan Pablo Isaza
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!