DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        When get build not Render my child components in Layout But when npm state It works right

        52 Views Asked by Amir esmaeelzadeh At 20 January 2023 at 12:45 2025-12-11T02:40:03.136514

        Layout components :

        1

        return (
                <>
                    <ToastContainer />
                    <div className='font-IranBold'>
                        <div className="border-b border-white dark:border-gray-500">
                            <ul className="flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500 dark:text-gray-400">
                                <Tab TabsInfo={TabsInfo} SetTabState={SetTabState} TabState={TabState} />
                            </ul>
                        </div>
                        <div>
                            {children}
                        </div>
                    </div>
                </>
            )
        

        Childs components in Layout :

          return (
        <>
          <Layout TabsInfo={TabsInfo} SetTabState={SetTabState} TabState={TabState}>
            {
              TabState === 1 ? <Contentfa AdminAboutFa={AdminAboutFa} /> : <Contenten AdminAboutEn={AdminAboutEn} />
            }
          </Layout>
        </>
        

        )

        When I run the project with npm start There is no problem and it runs. When I build, it only displays the names of the components :

        When run with npm start (open to show)

        But :

        When get build (open to show)

        javascript reactjs json components react-children
        Original Q&A
        1

        There are 1 best solutions below

        0
        Shaleen Kachhara Shaleen Kachhara On 24 January 2023 at 13:27

        Will need more info to suggest a solution. Especially what do you mean by this

        When I run the project with npm start There is no problem and it runs. When I build, it only displays the names of the components :

        since the code only executes on npm run start, npm run build is only for bundling the code, we still need to start the app to see anything on the frontend.

        Related Questions in JAVASCRIPT

        • Using Puppeteer to scrape a public API only when the data changes
        • inline SVG text (js)
        • An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
        • Storing the preferred font-size in localStorage
        • Simple movie API request not showing up in the console log
        • Authenticate Flask rest API
        • Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
        • How to request administrator rights?
        • mp4 embedded videos within github pages website not loading
        • Scrimba tutorial was working, suddenly stopped even trying the default
        • In Datatables, start value resets to 0, when column sorting
        • How do I link two models in mongoose?
        • parameter values only being sent to certain columns in google sheet?
        • Run main several times of wasm in browser
        • Variable inside a Variable, not updating

        Related Questions in REACTJS

        • ussd reader in Recket Native module
        • Teams tab application returns SSO error in mobile Outlook
        • Github Pages Deployment deploys a blank page
        • Is there any way to glow this bulb image like a real light bulb
        • Optimize LCP ReactJs
        • Page in React only renders elements after refreshing
        • Unable to Post Form Data to MongoDB because of picturepath
        • MERN Stack App - User Avatar Upload - 500 Error After Deployment on Render
        • Hooks are not supported inside an async component error in nextjs project using useQuery
        • How to change the Font Weight of a SelectValue component in React when a SelectItem is selected?
        • On the server side, it returns undefined but on the client side, logs the values no problem
        • Multilevel dropdown with checkboxes in Select component
        • TypeScript Error only on big type only when assigned to a variable
        • Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
        • Data is not filtering in props. Showing passdata.map is not a function

        Related Questions in JSON

        • Handling both JSON and form values in POST request body with unknown values in Golang
        • JSON Body is Not Passing Certain Strings
        • Custom rewriter for json
        • TypeScript: Type checking while parsing an arbitrary JSON that is typed/
        • I dont understand what to do with: System.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.IEnumerable`1
        • How to perform CRUD operations on a static JSON array in Angular? (without API)
        • Dynamic Nested Multi-Dimensional Arrays in Rust
        • Creating bar chart in FastAPI
        • How to encode ttsJson data?
        • Trying to get the id of the last element in my json file through an api
        • How to give index id to my uploaded json file in FastAPI?
        • JQ JSON - Values to Array
        • Spring boot JSON parse error: Unexpected character error
        • convert csv file with json data inside to a column, rows table in 2nd csv file
        • Sigma.JS custom rendering

        Related Questions in COMPONENTS

        • React deploying as blank screen, in locally works fine
        • How to pass a Blazor Component Instance to other Component and render it?
        • How to pass the result of a computed property to another component in Vue
        • Example on defining "New Components" compatible with the new Optimization class using Linopy
        • double form in shacn with error in inputs
        • How to make an animation happen everytime I click on a div that has the animation?
        • Smarty - Best way to create reusable components
        • Is there any library available same like notion select in React JS?
        • difference between vuejs local registration syntax
        • Add and remove dynamic component Angular
        • Is it possible to define paginator if its inside ngIf?
        • burger-menu bug with react (flickering)
        • app.routes won't recognize my component in Angular
        • Model attributes in the custom component controller of accelerator - How this is handled in the context of OCC and Spartacus?
        • Import angular components by string name

        Related Questions in REACT-CHILDREN

        • React children doesn't render appended content
        • How to solve TypeScript error in React.Children when using child.type
        • Pressables - Nesting, Passed Through Children, and Next to Absolutely Positioned Others. Can't press the child pressables
        • using children's props in Parent Component
        • React component pass down props to children
        • error in react child by udsing array in map function
        • Is it possible to create non-existing properties in child components in React?
        • How and when does React.cloneElement() make use of the cloned component's "constructor"?
        • Error: Objects are not valid as a React child while using useeffect and fetch
        • When get build not Render my child components in Layout But when npm state It works right
        • React: How to pass multiple server components to a client component?
        • Getting error "Uncaught Error: Objects are not valid as a React child", but I'm not passing objects as children
        • Expose a Custom Hook to Children (children only) in React
        • Check if child renders top-level React Fragment
        • React - Error while rendering child component with prop passed from parent component

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?
        .

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Math
        • Aftereffectstemplates