Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to create new file in template editor in react development mode #20482

Closed
Assignees
DanielleMaywood
Labels
s4Internal bugs (e.g. test flakes), extreme edge cases, and bug riskssiteArea: frontend dashboard
@DanielleMaywood

Description

@DanielleMaywood

In theCreateFileDialog component, we appear to have mutation happening on thesetFileTree setter.

setFileTree((fileTree)=>createFile(path,fileTree,""));

We can see the mutation happening in thecreateFile function withset from lodash.

returnset(fileTree,path.split("/"),value);

My understanding is that you aren't supposed to perform mutation on a React state value, so in Strict mode it'll call this function twice to see if you're violating this contract. As we're violating this contract, it gets called twice, and on that second invocationfileTree will contain the new file, and throw an error because the file already exists.

Metadata

Metadata

Labels

s4Internal bugs (e.g. test flakes), extreme edge cases, and bug riskssiteArea: frontend dashboard

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp