How to use the flux/stores/DataStore.js.getPageBySlug function in flux

To help you get started, we’ve selected a few flux 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 DreySkee / wp-api-react / src / scripts / components / Contact.js View on Github external
render() {
        let pageData = DataStore.getPageBySlug('contact');

        return (
            <div>
                <h2>Contact page template</h2>
                <h1>{pageData.title.rendered}</h1>

                <div>
                <div>{pageData.acf.text}</div>
            </div>
        );
    }
}</div>
github DreySkee / wp-api-react / src / scripts / components / Home.js View on Github external
render() {
        let pageData = DataStore.getPageBySlug('home');

        return (
            <div>
                <h2>Homepage template</h2>
                <h1>{pageData.title.rendered}</h1>

                <div>
                <div>{pageData.acf.text}</div>
            </div>
        );
    }
}</div>