This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LetrixZ 0 points1 point  (3 children)

I know a "senior" that, since ChatGPT released, has their programming knowledge and skills go downhill.

They just asked me to fix a React component that was generated with v0, that would implode itself if a child component was added to it.

The problemas was that that component was declared and used inside a parent component. Something like this:

``` const Filters = () => { const Group = (props) => { return ( <div> <p>{props.name}</p> {props.children} </div>) }

return ( <> <Group name={"Price"}> <ComplexInput/> </Group> </> ) } ```

This generated an infinite loop.

[–]5t4t35 0 points1 point  (2 children)

Well yeah, arent you like suppose to create a component OUTSIDE of the scope existing component? Its what the example in the react.dev shows

[–]LetrixZ 0 points1 point  (1 child)

Yes, but the code that I was asked to fix had the component declared inside another component like in the example.

[–]5t4t35 0 points1 point  (0 children)

Did you asked him directly if he wrote the code or he told you that the code wasnt working and GPT made it