How to use the @wq/react.useRenderContext function in @wq/react

To help you get started, we’ve selected a few @wq/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wq / wq.app / packages / map / src / hooks.js View on Github external
export function useMapConfig() {
    const { config } = usePlugin('map'),
        routeInfo = useRouteInfo(),
        context = useRenderContext();

    return routeMapConf(config, routeInfo, context);
}
github wq / wq.app / packages / material / src / views / IndexView.js View on Github external
export default function Index() {
    const reverse = useReverse(),
        { pages } = useRenderContext(),
        { ListItemLink } = useComponents();

    return (
        <div>
            {pages &amp;&amp; (
                
                    {pages.map(page =&gt; (
                        
                            {page.name}</div>
github wq / wq.app / packages / material / src / views / List.js View on Github external
export default function List() {
    const reverse = useReverse(),
        { list } = useRenderContext(),
        { page } = useRouteInfo(),
        { ListItemLink, Pagination } = useComponents();

    return (
        <div>
            
                {list.map(row =&gt; (
                    
                        {row.label}
                    
                ))}
            
            </div>
github wq / wq.app / packages / material / src / components / Pagination.js View on Github external
export default function Pagination() {
    const reverse = useReverse(),
        nav = useNav(),
        { multiple, page: pageNum, count, per_page } = useRenderContext(),
        { name: routeName, params } = useRouteInfo();

    if (!(multiple && count && per_page)) {
        return null;
    }

    const updateParams = newParams => {
        nav(
            reverse(
                routeName,
                {},
                {
                    ...params,
                    ...newParams
                }
            )
github wq / wq.app / packages / material / src / views / Detail.js View on Github external
function PropertyTable() {
    const context = useRenderContext(),
        { page_config } = useRouteInfo(),
        fields = page_config.form || [{ name: 'label' }];
    return (
        
            
                    {fields.map(field =&gt; (
                        
                            {field.label || field.name}
                            
                                
                            
                        
                    ))}
                <table>
                
            </table>