All right, let's take care of a little bit of code cleanup.
This is mostly just removing some unused variables, solving a couple of warnings and maybe also moving
around a couple of different files to get a little bit better project structure.
So first, inside our indexed TSX file, we're no longer making use of fact or USRAP inside here.
It's going to clean those up right away and then going to remove a couple of new lines up there.
OK, simple enough.
Then if we do a quick refresh, I want to take a look at some of the other warnings we have inside of
here.
So one warning that we have is that we are currently defining a aero function and then immediately exporting
it as default from inside that bundler index file that we just created a moment ago.
Instead of react up.
This is now flagged as being something that you might not want to do.
There's not necessarily anything wrong with it.
The reason that they have a warning here is essentially for debugging purposes.
If you export an anonymous function without providing a name to it, it just makes it a little bit harder
in the future to actually kind of figure out where that function is coming from.
If you instead name it ahead of time, then your air trace, if an error ever occurs, will more correctly
say, hey, an error just occurred inside of this function, inside of this file.
So this morning, right here, not super necessary, but we'll go ahead and follow its advice anyhow.
So back inside of our bundler index file, rather than just declaring our function and immediately exporting
it just to rename it to bundle.
And then we'll export default.
Bundle at the bottom.
Now, if we refresh, no more warning, very good.
OK, now, like I said, there's one other little thing I want to do, not tied to any warnings.
If we take a look at our project structure now, you'll notice that we've got that bundler directory
and as a sibling to it is the plugins folder, these plug ins folder, plug in folder right here are
all about working with the bundler.
But right now, that doesn't really appear that they are very much tied together.
So I just want to drag and drop or essentially move the plugins folder into the bundler directory just
to make sure that it's very clear, hey, everything inside this bundler directory is all about bundling
and transpiring code.
So just a little drag and drop.
That's pretty much it.
I'm going to drag plug ins, drop it into bundler, my editor is going to ask me if I actually want
to move this folder.
I do.
And then after that, it might also ask me if I want to automatically update any import statements.
I'm going to say no just so we can go through together and update these import statements together.
I'm going to update the manual.
Just make sure it's super clear what needs to be changed.
I'm going to say, no, don't do any updates for me.
Now, if we open up our index file inside a bundler, we will see two error messages right here.
We just have to change those two saying in the current directory, look for plug ins and find the relevant
plug in inside their.
All right, looks good.
So, as usual, one more test to make sure that we didn't break anything with a log on to three in to
submit that.
Yep, still works.
All right.
So we definitely have, without a doubt, a better project structure.
Now, everything is a little bit better organized and we've pulled out a ton of logic from our app component.
Now, I think that we've now that we've got this kind of like intermediate refactor out of the way,
we can start to think about adding in some more features to our app in the next video.