mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
react-reconciler: Update README.md (#13953)
Replaced 'var' with 'const'
This commit is contained in:
committed by
Dan Abramov
parent
6c404d82aa
commit
d34d1c3bae
@@ -9,16 +9,16 @@ This is an experimental package for creating custom React renderers.
|
||||
## API
|
||||
|
||||
```js
|
||||
var Reconciler = require('react-reconciler');
|
||||
const Reconciler = require('react-reconciler');
|
||||
|
||||
var HostConfig = {
|
||||
const HostConfig = {
|
||||
// You'll need to implement some methods here.
|
||||
// See below for more information and examples.
|
||||
};
|
||||
|
||||
var MyRenderer = Reconciler(HostConfig);
|
||||
const MyRenderer = Reconciler(HostConfig);
|
||||
|
||||
var RendererPublicAPI = {
|
||||
const RendererPublicAPI = {
|
||||
render(element, container, callback) {
|
||||
// Call MyRenderer.updateContainer() to schedule changes on the roots.
|
||||
// See ReactDOM, React Native, or React ART for practical examples.
|
||||
@@ -33,7 +33,7 @@ module.exports = RendererPublicAPI;
|
||||
A "host config" is an object that you need to provide, and that describes how to make something happen in the "host" environment (e.g. DOM, canvas, console, or whatever your rendering target is). It looks like this:
|
||||
|
||||
```js
|
||||
var HostConfig = {
|
||||
const HostConfig = {
|
||||
createInstance(type, props) {
|
||||
// e.g. DOM renderer returns a DOM node
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user