Currently working on a simple app using Symfony 4 and trying to add custom triggers in JavaScript. Having trouble getting my additional code to work as expected, even though it's compiled by Webpack via encore. It seems like my event is not triggering no matter where I place it. Any guidance would be appreciated since I am not well-versed in ES6.
assets/js/app.js
import '../css/app.scss';
import $ from 'jquery';
import 'bootstrap';
import './checkLoan'; // This is my file
app/js/checkLoan.js
export default function() {
console.log('Loaded successfully');
$('#my-button').click(function (event) {
event.preventDefault();
console.log('Button clicked!');
});
};