Question: Got this error: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.ts ( 7 0 0 9 ) Argument of type
Got this error:
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.ts
Argument of type 'Syllable is not assignable to parameter of type 'PuzzleProps'.
Property 'initialConfig' is missing in type 'Syllable but required in type 'PuzzleProps'.ts
boundary.tsx: 'initialConfig' is declared here.
parameter initialConfig: Syllable ;
On fololwoing code, how to resolve it:
import React,useState from "react";
import PuzzleController from controller;
import Syllable from model;
interface PuzzleProps
initialConfig: Syllable;
const Puzzle: React.FC initialConfig
const puzzleController setPuzzleController useStatenew PuzzleControllernew PuzzleinitialConfig;
const selected setSelected useState row: number, col: number nullnull;
const handleSyllableClick row: number, col: number
if selected
puzzleController.handleSwapselectedrow, selected.col, row, col;
setSelectednull; Reset selection after swap
else
setSelected row, col ; Select first syllable
;
const handleReset
puzzleController.handleReset;
setSelectednull;
;
const board puzzleController.getPuzzleState;
return
Swaps: puzzleControllergetSwapsScore: puzzleControllergetScoreSwaps: puzzleControllergetSwapsScore: puzzleControllergetScoreSwaps: puzzleControllergetSwapsScore: puzzleControllergetScore
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
