I have a problem with the code. I am trying to send data from a controller, to a library, to a view.
I get this error in view:
Message: Undefined variable: crimes
File_name: views / crime_view.php
Line: 45
during debugging, I unload the $ data variable and get:

which shows that my variables exist.
in the library, im getting controller data using:
$data[] = $componentData;
which will not work in this case. but if I'm in the library:
$data['crimes'] = "test";
then it will work. for some reason, it does not process incoming arrays from the controller.
how can i make this work?
full code:
function renderComponent($componentData = array())
{
$data[] = $componentData;
$data['rankDetails'] = $this->CI->user->rank_for_xp($userId);
var_dump($data);
$this->CI->load->view('components/crime/views/crime_view', $data);
}
example from the controller:

Q: How can I fix this to pass the necessary variables to it? so can i usually use the $ wait variable in the view?