can u edit this sentence? A potluck dinner is when friends or neighbors bring food to share.

is this correct or not?

A better way of saying this would be -

Friends and neighbors bring food to share at a potluck dinner.