Skip to content
Snippets Groups Projects
Unverified Commit 924d2ef0 authored by Khemissi Amir's avatar Khemissi Amir Committed by GitHub
Browse files

DropDowns: Removed dependency cycles between <Select/> and <Option/>. (#4167)

parent b62299b4
No related branches found
No related tags found
No related merge requests found
export const ACTIONS = {
SELECT: 'SELECT',
};
export default {};
import React from 'react';
const SelectContext = React.createContext(null);
export default SelectContext;
import React, { useCallback, useContext } from 'react';
import PropTypes from 'prop-types';
import { Dropdown } from 'react-bootstrap';
import { ACTIONS, SelectContext } from './Select';
import SelectContext from '../contexts/SelectContext';
import { ACTIONS } from '../constants/SelectConstants';
export default function Option({ children: title, value }) {
const { selected, dispatch } = useContext(SelectContext);
......
......@@ -3,12 +3,8 @@ import React, {
} from 'react';
import PropTypes from 'prop-types';
import { Dropdown } from 'react-bootstrap';
export const SelectContext = React.createContext(null);
export const ACTIONS = {
SELECT: 'SELECT',
};
import SelectContext from '../contexts/SelectContext';
import { ACTIONS } from '../constants/SelectConstants';
const reducer = (state, action) => {
switch (action.type) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment