Sitecore.React

  0 rating
7/25/2016 6:41:51 AM
8/15/2016 11:36:24 AM
Source: Link

About


The Sitecore.React module adds new rendering types: React Controller Rendering and React View Rendering. These renderings enable a developer to create the front end part of the component using React.


The React components support Experience Editor and Personalization in the same way that standard view and controller renderings do.


Full source is available on the GitHub repository. Full documentation is there too.


These blog posts will give some extra information too:


Documentation

Documentation
  • Documentation > Getting Started
    Getting Started
    Follow the instructions in the readme of the Github repository: https://github.com/GuitarRich/sitecore.react

    There are 2 parts to the module, the Sitecore package containing the new rendering templates and also a Nuget package containing the configuration and code required to build React components.
    0
Back
Release notes
Initial version contains:
 - React Controller Renderings
 - Automatic dynamic placeholders
 - Page edit and personalization support
Read more Back
Code examples
  • Code examples > Sample Controller Rendering
    Sample Controller Rendering
    public SampleReactController : Controller 
    {
        public ActionResult SampleReactRendering 
        {
            var data = new {
                Title = FieldRenderer(Sitecore.Context.Item, "Title"),
                Body = FieldRenderer(Sitecore.Context.Item, "Body")
            };
    
            return this.React("~/views/react/SampleReactRendering.jsx", data);
        }
    }
    Jsx file:
    var SampleReactRendering = React.createClass({
        render: function() {
            return (
                <div>
                    <h1 dangerouslySetInnerHTML={{__html: this.props.data.Title}}></h1>
                    <div dangerouslySetInnerHTML={{__html: this.props.data.Body}}></div>
                </div>
            );
        }
    });

    0

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File