Passing data to your component and validating the data