Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Randy_Johnson's avatar

ReactJS Funky Business on Passing Parameters

I didn't bother pasting to much of the second class since its quite big. But x just return undefined when I am passing 'hello'.

import React from 'react';
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
import { Head } from '@inertiajs/react';

import Table from '@/Components/Table';

export default function Index({ auth, objects }) {

  const x = ['id', 'desc', 'source', 'email_verified_at', 'created_at', 'updated_at'];
  const includes = ['password'];

  return (
    <AuthenticatedLayout
      user={auth.user}
      header={<h2 className="font-semibold text-xl text-gray-800 leading-tight ml-6">Dashboard</h2>}
    >
      <Head title="Dashboard" />
      <Table objects={objects} x='hello' />
    </AuthenticatedLayout>
  );
}
import React, { useState, useEffect } from 'react';
import { Link } from '@inertiajs/react';

import ModalCreate from '@/Components/ModalCreate';
import ModalUpdate from '@/Components/ModalUpdate';
import ModalDelete from '@/Components/ModalDelete';

import { FaArrowAltCircleRight } from "react-icons/fa";

export default function Table({ objects, x }) {

    // Modal data
    const [showCreate, setShowCreate] = useState(false);

    // Other
    const keys = Object.keys(objects[0] || {});
    const [toggle, setToggle] = useState(true);

    const exclude = ['id', 'desc', 'source', 'email_verified_at', 'created_at', 'updated_at'];
    const bold = ['name', 'head'];

    console.log(x);

0 likes
1 reply

Please or to participate in this conversation.