Skip to content

Instantly share code, notes, and snippets.

View torressam333's full-sized avatar
๐Ÿ“–
Proverbs 3:5

Samuel Torres torressam333

๐Ÿ“–
Proverbs 3:5
View GitHub Profile
@torressam333
torressam333 / HOCWithConfig.jsx
Created January 8, 2024 17:37
Higher Order Component with Configuration Example in React
/**
* This way, configuring a Higher-Order Component is essentially just the addition of another wrapping function around it.
* We accept custom messages for loading, no data or empty from the Wrapped Component
* OR, we provide default/generic fallback states if wrapped component doesn't provide them.
* @param {*} dataEmptyFeedback
* @param {*} noDataFeedback
* @param {*} dataEmptyFeedback
* @returns
*/
const withConditionalFeedback =
@torressam333
torressam333 / App.css
Created January 24, 2024 01:58
React Portal Example Implementation
.alert {
position: relative;
top: 10px;
left: 50%;
translate: -50%;
background-color: aquamarine;
color: black;
border-radius: 5px;
padding: 10px;
cursor: pointer;