appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 466 forks source link

initReactivesearch with url params example #440

Closed durdenx closed 6 years ago

durdenx commented 6 years ago

Issue Type: Enhancement

Platform: Web

Description: Add url params example for SSR guide

In what format should we use url params in initReactivesearch?

        return {
            store: await initReactivesearch(
                [
                    {
                        ...dataSearchProps,
                        type: 'DataSearch',
                        source: DataSearch,
                    },
                    {
                        ...reactiveListProps,
                        type: 'ReactiveList',
                        source: ReactiveList,
                    },
                ],
                null, // What instead of null?
                settings,
            ),
        };

Reactivesearch version: ^2.6.7

coommark commented 6 years ago

Well, I have this and it works right out of the box:

const categorySearchProps = {
    dataField: ["name", "description"],
    categoryField: 'category.raw',
    componentId: 'searchbox',
    defaultSelected: 'Phone',
    className: 'form-control',
    id: 'search-field',
    showIcon: false,
    URLParams: true,
};
durdenx commented 6 years ago

It works out of the box since the v2.6.8 update.