- TypeScript
- React
- Redux - State Management
- Redux-Thunk - Middleware for returning functions from actions (gives access to dispatch and getState to action)
- typesafe-actions - Typesafe Redux
- Selectors
- Axios - HTTP Client
- React Router
- withRouter - Injects components with route props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { join, resolve } = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const srcDir = resolve(__dirname, './src'); | |
const distDir = resolve(__dirname, './dist'); | |
const publicDir = resolve(__dirname, './public'); | |
const appIndexFile = join(publicDir, 'index.html'); |
- Start Date: 05-22-2018
Provide an approach that allows patternfly-react to consume patternfly-next. This approach will cover the following items:
- Keep
patternfly-react
in sync withpatternfly-next
core - Make it easy for consumers to include patternfly-react in their projects
- Enable code-splitting without workarounds
- No need for extra Webpack loaders
- No CSS to import
- Start Date: 05-22-2018
Provide an approach that allows patternfly-react to consume patternfly-next. This approach will cover the following items:
- Keep
patternfly-react
in sync withpatternfly-next
core - Make it easy for consumers to include patternfly-react in their projects
- Enable code-splitting without workarounds
- No need for extra Webpack loaders
- No CSS to import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import * as ReactDOM from 'react'; | |
let notifications = []; | |
function addNotification(notification) { | |
notifications = [...notifications, notification]; | |
} | |
function removeNotification(notification) { | |
const index = notifications.indexOf(notification); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
function Slot({ children, slot }) { | |
let slottedChild = null; // Default to null since react can render null if a slot isn't found | |
// Iterate over children to find the slot needed | |
React.children.forEach(children, (child) => { | |
if (!React.isValidElement(child)) { // Check that it is a valid react element. | |
return; // Return since we can't do anything with a child without props. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
$$typeof: Symbol(React.element), | |
key: null | key, | |
props: {}, | |
ref: Function, | |
type: Function | Class | string, | |
} |