If you want to make your snippet into a template for new files see https://stackoverflow.com/a/73043147/836330. Snippet template functionality is being built in to vscode.
Presumably you have found $TM_FILENAME_BASE from vscode snippet variables documentation as the variable you need to get the file name of the current file without its extension.
Ideally what you would like to do is a choice element (see Choice doc and something like this:
"const ${1|NameOfComponent},$TM_FILENAME_BASE|}...", // does not work
That won't work because according to the snippet grammar choice options can only be text:
choice ::= '${' int '|' text (',' text)* '|}'
So you would have to simulate a choice as close as possible. The following snippet does that in two ways:
"React Component": {
"prefix": "rfce",
"body": [
"import React, { useState, useEffect } from \"react\";",
"",
// "const ${1:NameOfComponent}${2:$TM_FILENAME_BASE} = () => {", // option 1 works
"const ${1:${2:NameOfComponent}${3:$TM_FILENAME_BASE}} = () => {", // option 2 works
" return (",
" <>",
" ${4:<div>Hello World</div>}",
" </>",
" );",
"};",
"",
"export default $1;" // uses option 2
],
"description": "React Component"
}
Option 1 simply lists both ${1:NameOfComponent}${2:$TM_FILENAME_BASE} presents both "options" - each will be selected in turn, just delete the one you don't want when it is selected and tab to go on. This is pretty straightforward but does require you to use the whole construction ${1:NameOfComponent}${2:$TM_FILENAME_BASE} every time you want that value.
Option 2 wraps the whole thing in another tabstop:
${1:${2:NameOfComponent}${3:$TM_FILENAME_BASE}}} which is a little trickier but then the result is put into tabstop $1 and then that is all you need to refer to when you want the result (as in the last line of the snippet).
You just have to practice a little - there is an extra tab at the start to select NameOfComponent. To accept it just tab past it to select the fileName and delete that, or vice versa - delete NameOfComponent when it is selected and tab to select the fileName - if you want it just tab to go on to the next tabstop.
The result of that inital tabstop will be put into $1 which can then be used elsewhere without the need to go through the option selection stuff again.
Here is a demo using option 2:

$TM_FILENAME_BASE