frankcollins3 / T.H.E.-

Take Home Exercise
0 stars 0 forks source link

non-chatgPT-attempt at component composition infinite prop setting loop? [11:18am] #16

Open frankcollins3 opened 2 months ago

frankcollins3 commented 2 months ago

attempting to do: // 👍 already solved w. chatGPT to use prototype-extension to assert a: .toMoney() custom func which converts to comma'd $ vals it mentioned favoring component composition. I wanted to test if it could do it but wanted to attempt first.

Screen Shot 2024-06-11 at 11 17 24 AM

error: how it's arranged it's now asking for the props in the return statement which it already handles in the function definition params

proposed approach: tinker before asking the function component shouldn't have those props it's already tackled? just realizing now those child props would go ../ out of this component into it's parent component those props belong on the parent which would be it's children component. no component has props in the component composition

frankcollins3 commented 2 months ago

nvm using chatGPT to save time. it's returned code had an error mentioning ReactNode doesn't permit promioses. change the interface { props: any } and 2 errs became 1. Screen Shot 2024-06-11 at 11 17 24 AM [11:26am]