Creating Custom react Component in rasa web chat

I am using RASA web chat Fronted provided by this repo: and I am trying to create custom react components to make charts, my problem is that i am unable to read rasa response (json or elements) to pass it to the component and decide which component to use based on this data, passing this argument to the chat widget will render the componet - customComponent={() => (

)} - but how to add data and logic to this rendering