Custom Gutenberg-Block esnext pass variables

The problem in your “edit” file is that your Edit() function in there is unpacking/destructuring the props, hence props is no longer defined or what you expected it to be.

So you should do function Edit( props ) and not function Edit({className, props}) — and it should be noted that className is in that props, i.e. props.className.

function Edit( props ) {
  console.log( props.className, props );
}

// .. Or when unpacking the props object:

// Assuming your block got an attribute named myAttribute.
function Edit( { attributes, setAttributes, className } ) {
  console.log( className, attributes.myAttribute );
}

I hope that helps and I suggest you to check, if you haven’t already done so, the block editor handbook, e.g. the “Edit and Save” section.

BTW, you don’t actually have that import Edit from './edit'; in the edit.js file, do you?