I’m trying to display JSX componnent to give feedback to a user after they submit a form.
When user submits then the loader happens:
export const loader: LoaderFunction = async (args: LoaderArgs) => {
// use the args to get some data for newDataArray
const newDataArray = [object, object, object]
if (newDataArray){
newDataArray.map((val, index) =>{
let time = Date.now()
let date = new Date(val.dateStamp).getTime()
let timeGap = time - date;
if(timeGap < 100000){
return <ResponseComponent data = {val} />
}
}
return json({newDataArray});
}
The loader is working, but the component never appears on the dom