The foundation grid system is not being implemented

How come my div is not affected by the foundation grid system:

  render: function(){
    var {todos,showCompleted,searchText} = this.state;
    var filteredTodos = TodoAPI.filterTodos(todos,showCompleted,searchText);
    return (
      <div>
        <h1 className="page-title">Todo App</h1>

        <div className="row">
          <div className="column small-centered small-5 medium-6 large-5">
            <div className="container">
              <TodoSearch onSearch = {this.handleSearch} />
              <TodoList todos ={filteredTodos} onToggle ={this.handleToggle}/>
              <AddTodo onAddTodo ={this.handleAddTodo}/>
            </div>
         </div>
       </div>
      </div>
    );
  }

When using firebug to debug the style, I couldn't find :

.large-5 {
    width: 33.3333%;
}

You can access the project repository here

Answer №1

To properly incorporate foundation into your project, you can import it as follows:

@import '~foundation-sites/scss/foundation';

If you encounter issues with applying styles, it may be due to the foundation-everything mixin generating different grid styles by default. To address this problem, consider modifying the mixin directly in your node_modules directory.

@mixin foundation-everything(
  $flex: true,
  $prototype: false
) {
  @if $flex {
    $global-flexbox: true !global;
  }

  @include foundation-global-styles;
  @if not $flex {
    @include foundation-grid;
  }
  @else {
    @if $xy-grid {
      @include foundation-xy-grid-classes;
    }
    @else {
      @include foundation-flex-grid;
    }
  }
)

This discrepancy in generated classes can be resolved by selectively including only the necessary foundation styles or making adjustments to the mixin itself. Another option is utilizing a package like react-foundation, depending on your project requirements.

Answer №2

Do you utilize React + Foundation?

It seems like the grid system is not being used correctly in this case.

In your situation, it should look something like this:

<div className="grid-basics-example">
  <Row className="display">
    <Column small={5} medium={6} large={5}>
       <TodoSearch onSearch = {this.handleSearch} />
       <TodoList todos ={filteredTodos} onToggle ={this.handleToggle}/>
       <AddTodo onAddTodo ={this.handleAddTodo}/>
    </Column>
  </Row>
</div>

For more information, visit:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Varied spacing between horizontal and vertical items in a list

The issue with the spacing between horizontal and vertical list items is perplexing. Despite having identical margin, padding, height, and width, they seem to display differently. While manual adjustment of margins or paddings can resolve this, I am curiou ...

Scrollbar width does not expand when hovered over

I am having trouble increasing the width of the scrollbar when hovering over it. However, I keep receiving an error in the console stating that 'scrollbar.addEventListener' is not a function. JAVASCRIPT setTimeout(function() { const scrollbar ...

Testing the useRef Hook's "current" prop in jest/enzyme: A beginner's guide

Could someone help me out with testing the useRef in the component shown below? I have a component that looks similar to this structure. I'm attempting to test the functionality within the otherFunction(), but I am unsure how to mock the current prop ...

React - updating key prop does not trigger re-render of child component

I have implemented react-infinite-scroll to display a continuous feed of data. My goal is to refresh the data feed whenever the user makes any changes to their settings. To achieve this, I am utilizing a key prop for the InfiniteScroll component. The conc ...

Error Message: Unable to access properties of an undefined object while interacting with an API in a React application

Creating a Weather application in React JS that utilizes the OpenWeatherMapAPI to display dynamic backgrounds based on the API response. I need to access the data at 'data.weather[0].main' which will contain values like 'Clear', ' ...

React - Error occurred when parsing module: Unexpected Token. It is recommended to use a suitable loader to manage this file format

As a beginner in using React, I might be making obvious mistakes and I apologize for that. After researching similar bugs on various platforms like StackOverflow and GitHub, I couldn't find a solution that works for my specific issue. Here is the erro ...

Adjusting the zoom feature in CSS3

I'm looking to have my React app display as if the user has changed the zoom level to 90%. I attempted to tackle this issue using CSS. body { transform: scale(0.9); } However, this method did not result in the screen appearing similar to wh ...

React MUI5 component latency when changing disable prop conditionally

I've been experiencing issues with latency when trying to conditionally enable/disable a Material UI button. This problem arose after updating my materialUi and reactjs to the latest versions (React 18, MUI/Material: 5.10.10). I'm using a sample ...

I am looking to create a responsive design for this Material UI component

I'm currently working on a project to monitor employees, and one of the components I have is the "create workspace" feature. I've added various elements to this interface and now I want to make it responsive. How can I achieve that? What are so ...

Get the image pathway for Gatsby from a JSON file

Update: Success! It may seem a bit unconventional, but I finally got it to work. If anyone has suggestions on how to use only the filename without a relative path, please share. Here's what worked for me: data.json [ { "slug": "blo ...

The CSS styling undergoes a transformation following the integration of Bootstrap

Hey there! I'm new to the world of web development and currently working on creating a simple todo list application. Recently, I revamped my webpage design by incorporating Bootstrap, and the results were pretty exciting! Original Code without Bootst ...

Combining various elements to produce a single outcome using Formik

My form consists of 3 <select> components: days, months, and years. These components are combined to act as one date picker. I attempted to utilize Formik's connect, along with setFieldValue and setFieldError functions, but encountered an issue ...

How to create a scrollable table using HTML and CSS

I created a Dashboard, but I'm having trouble making my mailPage scrollable. If you have some time to spare, could you please take a look at my website and help me with this issue? Here is my code: window.addEventListener("load", function () { ...

Tips for aligning inputs vertically and stretching them horizontally with bootstrap flex only

For a practice exercise, I want to achieve vertical left alignment and horizontal stretching of input fields using only Bootstrap Flex (or CSS3 flexbox), without relying on Bootstrap Grid or CSS3 grid layout. Here is the code snippet (also available on co ...

Explore the capabilities of redux independent of the react framework

I've been searching for hours trying to find a way to access the store (to dispatch and observe) without using React Components, but have had no luck. Here's my situation. I created the store in the root of the App: import { Provider } from &ap ...

useEffect invoked repeatedly

I've come across this reactjs code: import React, { useState, useEffect } from 'react' const Test = () => { const [counter, setCounter] = useState(0) useEffect(() => { const data = localStorage.getItem('counter&a ...

How to remove a specific entity ID in Spring Boot and React?

I'm currently working on a CRUD application. I am attempting to delete a student with a specific ID, however, I keep encountering a 400 error. Here is my controller class in Spring Boot: @DeleteMapping("/student/delete/{id}") public String deleteById( ...

Despite creating it, the create-react-app still refuses to run

*npm ERROR! code ELIFECYCLE npm ERROR! error number 1 npm ERROR! [email protected] start: react-scripts start npm ERROR! Exit status 1 npm ERROR! npm ERROR! Failed at the [email protected] start script. npm ERROR! This is probably not a pro ...

Incorporate multiple array values within an if statement

Looking to dynamically change the background image of an element based on specific strings in the URL. Rather than changing it for each individual term like "Site1", I want to be able to target multiple words. Here's what I've tried: var urlstri ...

Material-UI: Error thrown when attempting to pass props to makeStyles in React due to missing property 'X' on type '{}'

Currently experimenting with Adapting based on props, you can find more information here import React from 'react'; import { makeStyles } from '@material-ui/core'; const useStyles = makeStyles({ // style rule foo: props => ( ...