Ok, so I opened up a can of worms with the shop and drag/drop feature. Always knew that would happen. It got so bad that I considered rewriting the whole thing without ReactDnd due to this issue that I raised. I spent hours last night trying to figure out what went wrong with the library when the error was in my own code but it was causing the library to crash silently.

I’m still doing testing for the components, however, I’ve found out that with unit testing, if you incorrectly assume the input format, your tests will pass but your actual implementation will fail. So you need to make sure that there’s a test which makes sure the call to the function passes in the correct input. But this is the same problem, if you’ve assumed the wrong input, then the test passing the data in, will pass in the wrongly assumed input which will work for the case of the test but not in the real scenario.

I think at some level, I need to work out my data types because the lack of clarity around that is causing alot of strife within the code and my thinking.