Another React 101 - which is another functional programming recommendation - is that within your render method, never mutate the state of your components properties. If you need to modify your props your life will be a lot more enjoyable if instead of manipulating an array directly, you clone it somehow. If you want to change state its better to deal with it in a more suitable place, like component mounted() method. If you are struggling to grasp why not modifying your state and props is important, then imagine you have an array in you write some simple enough code, like array.splice(). this changes the original array, which causes React to call render. If you have to modify an array, you are better off using something like map, filter or reduce.
Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge