Skip to main content

Feed

Interfaces

FeedProps

Properties

PropertyTypeDescription
CustomAdvProps?CustomAdvPropsProps to spread to single custom adv element (this props can be used only if Custom Adv are enabled)

Default
{}
FeedSidebarProps?StickyBoxPropsProps to spread to the sidebar

Default
{}
FooterComponent?ElementType<any>Component used as footer. It will be displayed after the end messages

Default
<Footer>
FooterComponentProps?anyProps to spread to FooterComponent

Default
empty object
HeaderComponent?ElementComponent used as header. It will be displayed at the beginning of the feed

Default
null
ItemComponentElementType<any>Component used to render single feed item retrieved by the endpoint
ItemProps?anyProps to spread to single feed item

Default
empty object
ItemSkeletonElementType<any>Skeleton used to render loading effect during fetch
ItemSkeletonProps?anyProps to spread to single feed item skeleton

Default
empty object
PaginationLinkProps?Record<string, any>Props to spread to the pagination Link component

Default
{}
VirtualizedScrollerProps?VirtualizedScrollerCommonPropsProps to spread to VirtualizedScroller object.

Default
{}
cacheStrategy?CacheStrategiesCaching strategies

Default
CacheStrategies.CACHE_FIRST
className?stringOverrides or extends the styles applied to the component.

Default
null
disablePaginationLinks?booleanAdd/remove pagination links on top/bottom of items

Default
false
emptyFeedPlaceholder?ReactNodeEmpty feed placeholder, rendered when no feed item can be displayed

Default
null
enabledCustomAdvPositions?SCCustomAdvPosition[]Props to programmatically enable the custom adv position in the feed

Default
[SCCustomAdvPosition.POSITION_FEED_SIDEBAR, SCCustomAdvPosition.POSITION_FEED]
endMessage?ReactNodeEnd message, rendered when no more feed item can be displayed

Default
<FormattedMessage id="ui.feed.noOtherFeedObject" defaultMessage="ui.feed.noOtherFeedObject" />
endpointEndpointTypeFeed API Endpoint
endpointQueryParams?Record<string, string | number>Feed API Query Params

Default
[{'limit': 5}]
hideAdvs?booleanShow/hide adv banners

Default
false
hidePaginationLinks?booleanShow/hide pagination links

Default
true
id?stringId of the feed object

Default
'feed'
itemIdGenerator(item: any) => anyFunction used to generate an id from the single result returned by the Endpoint
itemPropsGenerator(scUser: SCUserType, item: any) => anyFunction used to convert the single result returned by the Endpoint into the props necessary to render the ItemComponent
onNextData?(page: number, offset: number, total: number, data: any[]) => anyCallback invoked whenever data is loaded during paging next
onPreviousData?(page: number, offset: number, total: number, data: any[]) => anyCallback invoked whenever data is loaded during paging previous
paginationLinksPageQueryParam?stringPage query parameter name

Default
'page'
prefetchedData?SCPaginatedResponse<SCFeedUnitType>Prefetch data. Useful for SSR.
Use this to init the component (in particular useSCFetchFeed)
refreshMessage?ReactNodeRefresh message, rendered when no more feed item can be displayed

Default
<FormattedMessage id="ui.feed.refreshRelease" defaultMessage="ui.feed.refreshRelease" />
requireAuthentication?booleanAuthenticated or not
scrollableTargetId?stringIf the feed is being rendered in a "scrollable container"
(for example, if one of the parent elements of the list is
styled with max-height and overflow: auto),
then passing the "scrollableTargetId"
widgets?SCFeedWidgetType[]Widgets to insert into the feed

Default
empty array

Type Aliases

FeedRef

FeedRef: object

FeedRef props

Type declaration

MemberType
addFeedData(obj, syncPagination?) => void
getCurrentFeedObjectIds() => number[]
refresh() => void

Source

packages/react-ui/src/components/Feed/Feed.tsx:72


FeedSidebarProps

FeedSidebarProps: StickyBoxProps

FeedSidebarProps has the same props as StickyBoxProps type

Source

packages/react-ui/src/components/Feed/Feed.tsx:67

Functions

FeedSkeleton()

FeedSkeleton(props): JSX.Element

API documentation for the Community-JS Feed Skeleton component. Learn about the available props and the CSS API.

Import

import {FeedSkeleton} from '@selfcommunity/react-ui';

Component Name

The name SCFeed-skeleton-root can be used when providing style overrides in the theme.

CSS

Rule NameGlobal classDescription
root.SCFeed-skeleton-rootStyles applied to the root element.
left.SCFeed-leftStyles applied to the left section.
right.SCFeed-rightStyles applied to the right section.

Parameters

ParameterType
propsFeedSkeletonProps

Returns

JSX.Element

Source

packages/react-ui/src/components/Feed/Skeleton.tsx:56


feed()

feed(props): ReactElement<any, string | JSXElementConstructor<any>>

NOTE: Exotic components are not callable.

Parameters

ParameterType
propsFeedProps & RefAttributes <FeedRef>

Returns

ReactElement<any, string | JSXElementConstructor<any>>

Source

packages/react-ui/src/components/Feed/Feed.tsx:887