#Translating //translate project 4322 words from Indonesia respond to English.

in utopian-io •  7 years ago  (edited)

Translating//translate project 4322 words from Indonesia respond to English.


Source

sssss.PNG

I am done translating the 53% of addons-test-utils.md :

You can check here the log of my activity.

  • [context.md](This blog post has a good explanation of why this is a problem and how you might get around it.) of react project
  • [conditional-rendering.md](For instance, componentWillUpdate and componentDidUpdate will still be called.) of react project
  • [composition-vs-inheritance.md](The components may import it and use that function, object, or a class, without extending it.)
  • [components-and-props.md](State allows React components to change their output over time in response to user actions, network responses, and anything else, without violating this rule.)

  • [addons-update.md]((Shallow) Merge)

  • [addons-two-way-binding-helper](That's it!)
    ()

  • [addons-test-utils.md](Same as scryRenderedComponentsWithType() but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.)

Translation Activity File :

You may check my activity on this link:
https://crowdin.com/project/react/id#

My Profile Activity as a translator:
https://crowdin.com/profile#

*This blog post has a good explanation of why this is a problem and how you might get around it. context.md Indonesian 11:44 AM
This is totally out of control of the components using context, so there's basically no way to reliably update the context. context.md Indonesian 11:44 AM
The problem is, if a context value provided by component changes, descendants that use that value won't update if an intermediate parent returns false from shouldComponentUpdate. context.md Indonesian 11:44 AM
This will trigger a new context and changes will be received by the children. context.md Indonesian 11:44 AM
In order to update data in the context, trigger a local state update with this.setState. context.md Indonesian 11:44 AM
The getChildContext function will be called when the state or props changes. context.md Indonesian 11:44 AM
React has an API to update context, but it is fundamentally broken and you should not use it. context.md Indonesian 11:43 AM
Don't do it. context.md Indonesian 11:43 AM
Updating Context context.md Indonesian 11:43 AM
The following code shows a Button component written as a stateless functional component. context.md Indonesian 11:43 AM
Stateless functional components are also able to reference context if contextTypes is defined as a property of the function. context.md Indonesian 11:43 AM
Referencing Context in Stateless Functional Components context.md Indonesian 11:43 AM
If contextTypes is defined within a component, the following lifecycle methods will receive an additional parameter, the context object: context.md Indonesian 11:43 AM
Referencing Context in Lifecycle Methods context.md Indonesian 11:43 AM
Before you build components with an API similar to this, consider if there are cleaner alternatives. For example, you can pass entire React component as props if you'd like to. context.md Indonesian 11:43 AM
By passing down some information from the Router component, each Link and Route can communicate back to the containing Router. context.md Indonesian 11:43 AM
Context can also let you build an API where parents and children communicate. For example, one library that works this way is React Router V4: context.md Indonesian 11:43 AM
Parent-Child Coupling context.md Indonesian 11:43 AM
If contextTypes is not defined, then context will be an empty object. context.md Indonesian 11:43 AM
By adding childContextTypes and getChildContext to MessageList (the context provider), React passes the information down automatically and any component in the subtree (in this case, Button) can access it by defining contextTypes. context.md Indonesian 11:43 AM
Using context, we can pass this through the tree automatically: context.md Indonesian 11:43 AM
In this example, we manually thread through a color prop in order to style the Button and Message components appropriately. context.md Indonesian 11:43 AM
Suppose you have a structure like: context.md Indonesian 11:43 AM
How To Use Context context.md Indonesian 11:43 AM
If you insist on using context despite these warnings, try to isolate your use of context to a small area and avoid using the context API directly when possible so that it's easier to upgrade when the API changes. context.md Indonesian 11:43 AM
If you aren't an experienced React developer, don't use context. There is usually a better way to implement functionality just using props and state. context.md Indonesian 11:43 AM
It is far more likely that Redux is the right solution to your problem than that context is the right solution. context.md Indonesian 11:42 AM
For many practical applications, these libraries and their React bindings are a good choice for managing state that is relevant to many components. context.md Indonesian 11:42 AM
If you aren't familiar with state management libraries like Redux or MobX, don't use context. context.md Indonesian 11:42 AM
If you want your application to be stable, don't use context. It is an experimental API and it is likely to break in future releases of React. context.md Indonesian 11:42 AM
The vast majority of applications do not need to use context. context.md Indonesian 11:42 AM
Why Not To Use Context context.md Indonesian 11:42 AM
In some cases, you want to pass data through the component tree without having to pass the props down manually at every level. You can do this directly in React with the powerful "context" API. context.md Indonesian 11:42 AM
With React, it's easy to track the flow of data through your React components. When you look at a component, you can see which props are being passed, which makes your apps easy to reason about. context.md Indonesian 11:42 AM
We provide a codemod script to automate the conversion. context.md Indonesian 11:42 AM
React.PropTypes </ code> telah berpindah ke paket yang berbeda sejak React v15.5. Silakan gunakan yang prop-jenis </ code> perpustakaan bukan untuk mendefinisikan contextTypes </ code >. context.md Indonesian 11:41 AM
Context context.md Indonesian 11:41 AM
For instance, componentWillUpdate and componentDidUpdate will still be called. conditional-rendering.md Indonesian 11:41 AM
Returning null from a component's render method does not affect the firing of the component's lifecycle methods. conditional-rendering.md Indonesian 11:41 AM
If the value of the prop is false, then the component does not render: conditional-rendering.md Indonesian 11:41 AM
In the example below, the <WarningBanner /> is rendered depending on the value of the prop called warn. conditional-rendering.md Indonesian 11:41 AM
In rare cases you might want a component to hide itself even though it was rendered by another component. To do this return null instead of its render output. conditional-rendering.md Indonesian 11:40 AM
Preventing Component from Rendering conditional-rendering.md Indonesian 11:40 AM
Also remember that whenever conditions become too complex, it might be a good time to
extract a component. conditional-rendering.md Indonesian 11:40 AM
Just like in JavaScript, it is up to you to choose an appropriate style based on what you and your team consider more readable. conditional-rendering.md Indonesian 11:40 AM
It can also be used for larger expressions although it is less obvious what's going on: conditional-rendering.md Indonesian 11:40 AM
In the example below, we use it to conditionally render a small block of text. conditional-rendering.md Indonesian 11:40 AM
true: false
. conditional-rendering.md Indonesian 11:40 AM
Another method for conditionally rendering elements inline is to use the JavaScript conditional operator condition ? conditional-rendering.md Indonesian 11:39 AM
Inline If-Else with Conditional Operator conditional-rendering.md Indonesian 11:39 AM
Therefore, if the condition is true, the element right after && will appear in the output. If it is false, React will ignore and skip it. conditional-rendering.md Indonesian 11:39 AM
It works because in JavaScript, true && expression always evaluates to expression, and false && expression always evaluates to false. conditional-rendering.md Indonesian 11:39 AM
It can be handy for conditionally including an element: conditional-rendering.md Indonesian 11:39 AM
This includes the JavaScript logical && operator. conditional-rendering.md Indonesian 11:39 AM
You may
embed any expressions in JSX by wrapping them in curly braces. conditional-rendering.md Indonesian 11:39 AM
Inline If with Logical && Operator conditional-rendering.md Indonesian 11:39 AM
There are a few ways to inline conditions in JSX, explained below. conditional-rendering.md Indonesian 11:39 AM
While declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a shorter syntax. conditional-rendering.md Indonesian 11:39 AM
It will also render a <Greeting /> from the previous example: conditional-rendering.md Indonesian 11:39 AM
It will render either <LoginButton /> or <LogoutButton /> depending on its current state. conditional-rendering.md Indonesian 11:39 AM
In the example below, we will create a stateful component called LoginControl. conditional-rendering.md Indonesian 11:38 AM
Consider these two new components representing Logout and Login buttons: conditional-rendering.md Indonesian 11:38 AM
You can use variables to store elements. This can help you conditionally render a part of the component while the rest of the output doesn't change. conditional-rendering.md Indonesian 11:38 AM
Element Variables conditional-rendering.md Indonesian 11:38 AM
This example renders a different greeting depending on the value of isLoggedIn prop. conditional-rendering.md Indonesian 11:38 AM
We'll create a Greeting component that displays either of these components depending on whether a user is logged in: conditional-rendering.md Indonesian 11:37 AM
Consider these two components: conditional-rendering.md Indonesian 11:37 AM
Use JavaScript operators like if or the conditional operator to create elements representing the current state, and let React update the UI to match them. conditional-rendering.md Indonesian 11:37 AM
Conditional rendering in React works the same way conditions work in JavaScript. conditional-rendering.md Indonesian 11:37 AM
In React, you can create distinct components that encapsulate behavior you need. Then, you can render only some of them, depending on the state of your application. conditional-rendering.md Indonesian 11:37 AM
Conditional Rendering conditional-rendering.md Indonesian 11:37 AM
The components may import it and use that function, object, or a class, without extending it. composition-vs-inheritance.md Indonesian 11:37 AM
If you want to reuse non-UI functionality between components, we suggest extracting it into a separate JavaScript module. composition-vs-inheritance.md Indonesian 11:37 AM
Remember that components may accept arbitrary props, including primitive values, React elements, or functions. composition-vs-inheritance.md Indonesian 11:37 AM
Props and composition give you all the flexibility you need to customize a component's look and behavior in an explicit and safe way. composition-vs-inheritance.md Indonesian 11:37 AM
At Facebook, we use React in thousands of components, and we haven't found any use cases where we would recommend creating component inheritance hierarchies. composition-vs-inheritance.md Indonesian 11:37 AM
So What About Inheritance? composition-vs-inheritance.md Indonesian 11:36 AM
Composition works equally well for components defined as classes: composition-vs-inheritance.md Indonesian 11:36 AM
In React, this is also achieved by composition, where a more "specific" component renders a more "generic" one and configures it with props: composition-vs-inheritance.md Indonesian 11:36 AM
Sometimes we think about components as being "special cases" of other components. For example, we might say that a WelcomeDialog is a special case of Dialog. composition-vs-inheritance.md Indonesian 11:36 AM
Specialization composition-vs-inheritance.md Indonesian 11:36 AM
React elements like <Contacts /> and <Chat /> are just objects, so you can pass them as props like any other data. composition-vs-inheritance.md Indonesian 11:36 AM
While this is less common, sometimes you might need multiple "holes" in a component. In such cases you may come up with your own convention instead of using children: composition-vs-inheritance.md Indonesian 11:36 AM
Since FancyBorder renders {props.children} inside a <div>, the passed elements appear in the final output. composition-vs-inheritance.md Indonesian 11:36 AM
Anything inside the <FancyBorder> JSX tag gets passed into the FancyBorder component as a children prop. composition-vs-inheritance.md Indonesian 11:36 AM
This lets other components pass arbitrary children to them by nesting the JSX: composition-vs-inheritance.md Indonesian 11:36 AM
We recommend that such components use the special children prop to pass children elements directly into their output: composition-vs-inheritance.md Indonesian 11:36 AM
Some components don't know their children ahead of time. This is especially common for components like Sidebar or Dialog that represent generic "boxes". composition-vs-inheritance.md Indonesian 11:35 AM
Containment composition-vs-inheritance.md Indonesian 11:35 AM
In this section, we will consider a few problems where developers new to React often reach for inheritance, and show how we can solve them with composition. composition-vs-inheritance.md Indonesian 11:35 AM
React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components. composition-vs-inheritance.md Indonesian 11:35 AM
Composition vs Inheritance composition-vs-inheritance.md Indonesian 11:34 AM
State allows React components to change their output over time in response to user actions, network responses, and anything else, without violating this rule. components-and-props.md Indonesian 11:34 AM
State allows React components to change their output over time in response to user actions, network responses, and anything else, without violating this rule. components-and-props.md Indonesian 11:34 AM
In the next section, we will introduce a new concept of "state". components-and-props.md Indonesian 11:34 AM
Of course, application UIs are dynamic and change over time. components-and-props.md Indonesian 11:34 AM
All React components must act like pure functions with respect to their props. components-and-props.md Indonesian 11:34 AM
React is pretty flexible but it has a single strict rule: components-and-props.md Indonesian 11:34 AM
In contrast, this function is impure because it changes its own input: components-and-props.md Indonesian 11:33 AM
Such functions are called "pure" because they do not attempt to change their inputs, and always return the same result for the same inputs. components-and-props.md Indonesian 11:33 AM
Whether you declare a component as a function or a class, it must never modify its own props. Consider this sum function: components-and-props.md Indonesian 11:33 AM
Props are Read-Only components-and-props.md Indonesian 11:33 AM
A good rule of thumb is that if a part of your UI is used several times (Button, Panel, Avatar), or is complex enough on its own (App, FeedStory, Comment), it is a good candidate to be a reusable component. components-and-props.md Indonesian 11:33 AM
Extracting components might seem like grunt work at first, but having a palette of reusable components pays off in larger apps. components-and-props.md Indonesian 11:33 AM
This lets us simplify Comment even further: components-and-props.md Indonesian 11:33 AM
Next, we will extract a UserInfo component that renders an Avatar next to user's name: components-and-props.md Indonesian 11:33 AM
We can now simplify Comment a tiny bit: components-and-props.md Indonesian 11:33 AM
We recommend naming props from the component's own point of view rather than the context in which it is being used. components-and-props.md Indonesian 11:33 AM
This is why we have given its prop a more generic name: user rather than author. components-and-props.md Indonesian 11:33 AM
The Avatar doesn't need to know that it is being rendered inside a Comment. components-and-props.md Indonesian 11:33 AM
First, we will extract Avatar: components-and-props.md Indonesian 11:33 AM
This component can be tricky to change because of all the nesting, and it is also hard to reuse individual parts of it. Let's extract a few components from it. components-and-props.md Indonesian 11:33 AM
It accepts author (an object), text (a string), and date (a date) as props, and describes a comment on a social media website. components-and-props.md Indonesian 11:33 AM
For example, consider this Comment component: components-and-props.md Indonesian 11:33 AM
Don't be afraid to split components into smaller components. components-and-props.md Indonesian 11:33 AM
Extracting Components components-and-props.md Indonesian 11:33 AM
Components must return a single root element. This is why we added a <div> to contain all the <Welcome /> elements. components-and-props.md Indonesian 11:33 AM
However, if you integrate React into an existing app, you might start bottom-up with a small component like Button and gradually work your way to the top of the view hierarchy. components-and-props.md Indonesian 11:33 AM
Typically, new React apps have a single App component at the very top. components-and-props.md Indonesian 11:32 AM
For example, we can create an App component that renders Welcome many times: components-and-props.md Indonesian 11:30 AM
A button, a form, a dialog, a screen: in React apps, all those are commonly expressed as components. components-and-props.md Indonesian 11:30 AM
This lets us use the same component abstraction for any level of detail. components-and-props.md Indonesian 11:29 AM
Components can refer to other components in their output. components-and-props.md Indonesian 11:29 AM
Composing Components components-and-props.md Indonesian 11:29 AM
For example, <div /> represents a DOM tag, but <Welcome /> represents a component and requires Welcome to be in scope. components-and-props.md Indonesian 11:29 AM
Always start component names with a capital letter. components-and-props.md Indonesian 11:29 AM
Caveat: components-and-props.md Indonesian 11:29 AM
React DOM efficiently updates the DOM to match <h1>Hello, Sara</h1>. components-and-props.md Indonesian 11:29 AM
Our Welcome component returns a <h1>Hello, Sara</h1> element as the result. components-and-props.md Indonesian 11:28 AM
React calls the Welcome component with {name: 'Sara'} as the props. components-and-props.md Indonesian 11:28 AM
We call ReactDOM.render() with the <Welcome name="Sara" /> element. components-and-props.md Indonesian 11:28 AM
Let's recap what happens in this example: components-and-props.md Indonesian 11:28 AM
Try it on CodePen. components-and-props.md Indonesian 11:28 AM
For example, this code renders "Hello, Sara" on the page: components-and-props.md Indonesian 11:28 AM
When React sees an element representing a user-defined component, it passes JSX attributes to this component as a single object. We call this object "props". components-and-props.md Indonesian 11:28 AM
const element = <Welcome name="Sara" />; components-and-props.md Indonesian 11:28 AM
However, elements can also represent user-defined components: components-and-props.md Indonesian 11:28 AM
Previously, we only encountered React elements that represent DOM tags: components-and-props.md Indonesian 11:28 AM
Rendering a Component components-and-props.md Indonesian 11:28 AM
Classes have some additional features that we will discuss in the next sections. Until then, we will use functional components for their conciseness. components-and-props.md Indonesian 11:27 AM
The above two components are equivalent from React's point of view. components-and-props.md Indonesian 11:27 AM
You can also use an ES6 class to define a component: components-and-props.md Indonesian 11:27 AM
We call such components "functional" because they are literally JavaScript functions. components-and-props.md Indonesian 11:26 AM
This function is a valid React component because it accepts a single "props" object argument with data and returns a React element. components-and-props.md Indonesian 11:26 AM
The simplest way to define a component is to write a JavaScript function: components-and-props.md Indonesian 11:26 AM
Functional and Class Components components-and-props.md Indonesian 11:26 AM
Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen. components-and-props.md Indonesian 11:04 AM
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. components-and-props.md Indonesian 11:04 AM
Components and Props components-and-props.md Indonesian 11:03 AM
(Shallow) Merge addons-update.md Indonesian 10:59 AM
Updating a value based on its current one addons-update.md Indonesian 10:59 AM
This accesses collection's index 2, key a, and does a splice of one item starting from index 1 (to remove 17) while inserting 13 and 14. addons-update.md Indonesian 10:59 AM
Nested collections addons-update.md Indonesian 10:59 AM
Simple push addons-update.md Indonesian 10:59 AM
Examples addons-update.md Indonesian 10:59 AM
{$apply: function} passes in the current value to the function and updates it with the new returned value. addons-update.md Indonesian 10:59 AM
{$merge: object} merge the keys of object with the target. addons-update.md Indonesian 10:59 AM
{$set: any} replace the target entirely. addons-update.md Indonesian 10:59 AM
{$splice: array of arrays} for each item in arrays call splice() on the target with the parameters provided by the item. addons-update.md Indonesian 10:59 AM
{$unshift: array} unshift() all the items in array on the target. addons-update.md Indonesian 10:59 AM
{$push: array} push() all the items in array on the target. addons-update.md Indonesian 10:58 AM
Available Commands addons-update.md Indonesian 10:58 AM
The $-prefixed keys are called commands. The data structure they are "mutating" is called the target. addons-update.md Indonesian 10:58 AM
While the syntax takes a little getting used to (though it's inspired by MongoDB's query language) there's no redundancy, it's statically analyzable and it's not much more typing than the mutative version. addons-update.md Indonesian 10:58 AM
update() provides simple syntactic sugar around this pattern to make writing this code easier. This code becomes: addons-update.md Indonesian 10:58 AM
update() addons-update.md Indonesian 10:58 AM
This is not only annoying, but also provides a large surface area for bugs. addons-update.md Indonesian 10:58 AM
Look at all the repetition! addons-update.md Indonesian 10:58 AM
While this is fairly performant (since it only makes a shallow copy of log n objects and reuses the rest), it's a big pain to write. addons-update.md Indonesian 10:58 AM
Unfortunately, in today's JavaScript this can be cumbersome: addons-update.md Indonesian 10:58 AM
You can alleviate this by only copying objects that need to be changed and by reusing the objects that haven't changed. addons-update.md Indonesian 10:58 AM
Unfortunately, deep copies are expensive, and sometimes impossible. addons-update.md Indonesian 10:58 AM
Then you can compare the old copy of myData with the new one in shouldComponentUpdate() using triple-equals: addons-update.md Indonesian 10:57 AM
Instead, you need to create a new copy of myData and change only the parts of it that need to be changed. addons-update.md Indonesian 10:57 AM
You have no way of determining which data has changed since the previous copy has been overwritten. addons-update.md Indonesian 10:57 AM
If your mutate data like this: addons-update.md Indonesian 10:57 AM
The Main Ideas addons-update.md Indonesian 10:57 AM
You can also take a look at Facebook's Immutable-js and the Advanced a Performance section for more detail on Immutable-js. addons-update.md Indonesian 10:57 AM
However, we've provided a simple immutability helper, update(), that makeing dealing with this type of data much easier, without fundamentally changing how your data is represented. addons-update.md Indonesian 10:56 AM
Dealing with immutable data in JavaScript is more difficult than in languages designed for it, like Clojure. addons-update.md Indonesian 10:56 AM
However, if you can use immutable data in performance-critical parts of your application it's easy to implement a fast shouldComponentUpdate() method to significantly speed up your app. addons-update.md Indonesian 10:56 AM
React lets you use whatever style of data management you want, including mutation. addons-update.md Indonesian 10:56 AM
update is a legacy add-on. Use immutability-helper instead. addons-update.md Indonesian 10:56 AM
Immutability Helpers addons-update.md Indonesian 10:56 AM
That's it! addons-two-way-binding-helpers.md Indonesian 10:56 AM
It simply handles the onChange event and calls this.props.valueLink.requestChange() and also uses this.props.valueLink.value instead of this.props.value. addons-two-way-binding-helpers.md Indonesian 10:55 AM
The valueLink prop is also quite simple. addons-two-way-binding-helpers.md Indonesian 10:55 AM
LinkedStateMixin Without valueLink addons-two-way-binding-helpers.md Indonesian 10:55 AM
And LinkedStateMixin is similarly simple: it just populates those fields with a value from this.state and a callback that calls this.setState(). addons-two-way-binding-helpers.md Indonesian 10:55 AM
As you can see, valueLink objects are very simple objects that just have a value and requestChange prop. addons-two-way-binding-helpers.md Indonesian 10:55 AM
valueLink Without LinkedStateMixin addons-two-way-binding-helpers.md Indonesian 10:55 AM
To prove how simple LinkedStateMixin is, let's rewrite each side separately to be more explicit. addons-two-way-binding-helpers.md Indonesian 10:55 AM
There are two sides to LinkedStateMixin: the place where you create the valueLink instance and the place where you use it. addons-two-way-binding-helpers.md Indonesian 10:55 AM
Under the Hood addons-two-way-binding-helpers.md Indonesian 10:55 AM
For checkboxes, you should use checkedLink instead of valueLink: addons-two-way-binding-helpers.md Indonesian 10:55 AM
The value attribute is not updated when the checkbox is checked or unchecked. addons-two-way-binding-helpers.md Indonesian 10:55 AM
Note that checkboxes have a special behavior regarding their value attribute, which is the value that will be sent on form submit if the checkbox is checked (defaults to on). addons-two-way-binding-helpers.md Indonesian 10:55 AM
valueLink objects can be passed up and down the tree as props, so it's easy (and explicit) to set up two-way binding between a component deep in the hierarchy and state that lives higher in the hierarchy. addons-two-way-binding-helpers.md Indonesian 10:55 AM
linkState() returns a valueLink object which contains the current value of the React state and a callback to change it. addons-two-way-binding-helpers.md Indonesian 10:55 AM
LinkedStateMixin adds a method to your React component called linkState(). addons-two-way-binding-helpers.md Indonesian 10:55 AM
This works really well and it's very clear how data is flowing, however, with a lot of form fields it could get a bit verbose. Let's use LinkedStateMixin to save us some typing: addons-two-way-binding-helpers.md Indonesian 10:55 AM
Here's a simple form example without using LinkedStateMixin: addons-two-way-binding-helpers.md Indonesian 10:54 AM
LinkedStateMixin: Before and After addons-two-way-binding-helpers.md Indonesian 10:54 AM
It doesn't fundamentally change how data flows in your React application. addons-two-way-binding-helpers.md Indonesian 10:54 AM
LinkedStateMixin is just a thin wrapper and convention around the onChange/setState() pattern. addons-two-way-binding-helpers.md Indonesian 10:54 AM
We've provided LinkedStateMixin: syntactic sugar for setting up the common data flow loop pattern described above, or "linking" some data source to React state. addons-two-way-binding-helpers.md Indonesian 10:54 AM
Two-way binding -- implicitly enforcing that some value in the DOM is always consistent with some React state -- is concise and supports a wide variety of applications. addons-two-way-binding-helpers.md Indonesian 10:54 AM
See our forms documentation for more information. addons-two-way-binding-helpers.md Indonesian 10:54 AM
"Closing the data flow loop" explicitly leads to more understandable and easier-to-maintain programs. addons-two-way-binding-helpers.md Indonesian 10:54 AM
In React, you would implement this by listening to a "change" event, read from your data source (usually the DOM) and call setState() on one of your components. addons-two-way-binding-helpers.md Indonesian 10:54 AM
Or perhaps you want to perform layout in JavaScript and react to changes in some DOM element size. addons-two-way-binding-helpers.md Indonesian 10:54 AM
For example, when developing forms, you'll often want to update some React state when you receive user input. addons-two-way-binding-helpers.md Indonesian 10:54 AM
However, there are lots of applications that require you to read some data and flow it back into your program. addons-two-way-binding-helpers.md Indonesian 10:54 AM
In React, data flows one way: from owner to child. We think that this makes your app's code easier to understand. You can think of it as "one-way data binding." addons-two-way-binding-helpers.md Indonesian 10:54 AM
LinkedStateMixin is an easy way to express two-way binding with React. addons-two-way-binding-helpers.md Indonesian 10:54 AM
import to LinkedStateMixin dari 're-addons-linked-state-mixin'; // ES6 var LinkedStateMixin = require ('re-addons-linked-state-mixin'); // ES5 dengan npm addons-two-way-binding-helpers.md Indonesian 10:54 AM
LinkedStateMixin is deprecated as of React v15. The recommendation is to explicitly set the value and change handler, instead of using LinkedStateMixin. addons-two-way-binding-helpers.md Indonesian 10:53 AM
Two-way Binding Helpers addons-two-way-binding-helpers.md Indonesian 10:53 AM
Same as scryRenderedComponentsWithType() but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one. addons-test-utils.md Indonesian 10:53 AM
Finds all instances of components with type equal to componentClass. addons-test-utils.md Indonesian 10:53 AM
Like scryRenderedDOMComponentsWithTag() but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one. addons-test-utils.md Indonesian 10:53 AM
Finds all DOM elements of components in the rendered tree that are DOM components with the tag name matching tagName. addons-test-utils.md Indonesian 10:53 AM
Like scryRenderedDOMComponentsWithClass() but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one. addons-test-utils.md Indonesian 10:53 AM
Finds all DOM elements of components in the rendered tree that are DOM components with the class name matching className. addons-test-utils.md Indonesian 10:53 AM
This is not that useful on its own, but it's used as a primitive for other test utils. addons-test-utils.md Indonesian 10:53 AM
Traverse all components in tree and accumulate all components where test(component) is true. addons-test-utils.md Indonesian 10:53 AM
Returns true if instance is a component whose type is of a React componentClass. addons-test-utils.md Indonesian 10:52 AM
Returns true if instance is a user-defined component, such as a class or a function. addons-test-utils.md Indonesian 10:52 AM
Returns true if instance is a DOM component (such as a <div> or <span>). addons-test-utils.md Indonesian 10:52 AM
Returns true if element is a React element whose type is of a React componentClass. addons-test-utils.md Indonesian 10:52 AM
Returns true if element is any React element. addons-test-utils.md Indonesian 10:52 AM
Instead of rendering as usual, the component will become a simple <div> (or other tag if mockTagName is provided) containing any provided children. addons-test-utils.md Indonesian 10:52 AM
Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. addons-test-utils.md Indonesian 10:52 AM
Otherwise React will think it can't access the DOM and methods like setState won't work. addons-test-utils.md Indonesian 10:52 AM
You will need to have window, window.document and window.document.createElement globally available before you import React. addons-test-utils.md Indonesian 10:52 AM
Render a React element into a detached DOM node in the document. This function requires a DOM. addons-test-utils.md Indonesian 10:52 AM
You will have to provide any event property that you're using in your component (e.g. keyCode, which, etc...) as React is not creating any of these for you. addons-test-utils.md Indonesian 10:52 AM
// <input ref="input" /> const node = this.refs.input; node.value = 'giraffe'; ReactTestUtils.Simulate.change(node); ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13}); addons-test-utils.md Indonesian 10:52 AM
Changing the value of an input field and then pressing ENTER. addons-test-utils.md Indonesian 10:52 AM
// <button ref="button">...</button> const node = this.refs.button; ReactTestUtils.Simulate.click(node); addons-test-utils.md Indonesian 10:52 AM
Clicking an element addons-test-utils.md Indonesian 10:51 AM
Simulate has a method for every event that React understands. addons-test-utils.md Indonesian 10:51 AM
Simulate an event dispatch on a DOM node with optional eventData event data. addons-test-utils.md Indonesian 10:51 AM
Other Utilities addons-test-utils.md Indonesian 10:51 AM
The shallow renderer has moved to react-test-renderer/shallow.
Learn more about shallow rendering on its reference page. addons-test-utils.md Indonesian 10:51 AM
Shallow Rendering addons-test-utils.md Indonesian 10:51 AM
If you're deciding on a unit testing utility to use together with Jest, or any other test runner, it's worth checking out: http://airbnb.io/enzyme/ addons-test-utils.md Indonesian 10:51 AM
Airbnb has released a testing utility called Enzyme, which makes it easy to assert, manipulate, and traverse your React Components' output. addons-test-utils.md Indonesian 10:51 AM
Learn how to get started with Jest through the Jest website's React Tutorial. addons-test-utils.md Indonesian 10:51 AM
At Facebook we use Jest for painless JavaScript testing. addons-test-utils.md Indonesian 10:51 AM
ReactTestUtils makes it easy to test React components in the testing framework of your choice. addons-test-utils.md Indonesian 10:51 AM
Test Utilities addons-test-utils.md Indonesian 10:51 AM

Each string contains words that are too much and raw.


With circled the name of God most compassionate and loving Again. I tried working on this contribution. May be accepted and useful, thank you.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your contribution cannot be approved yet. See the Utopian Rules. Please edit your contribution to reapply for approval.

  • Please add link your activity clearly.
    You may edit your post here, as shown below:

You can contact us on Discord.
[utopian-moderator]

Thank you moderator! You are very wise. I s added a link of my activity. Thanks a lot @daiky69

Your contribution cannot be approved because it does not follow the Utopian Rules. we discourage the use of any machine translator when contributing in utopian.io please notify that you may get banned if you continue using machine translator.

You can contact us on Discord.
[utopian-moderator]