Giter Club home page Giter Club logo

react-nl2br's Introduction

react-nl2br

USAGE

const nl2br = require('react-nl2br');
const result = nl2br('aaa\nbbb\nccc\nddd');
console.log(result); // aaa, ReactElement('br'), bbb, ReactElement('br'), ccc, ReactElement('br'), ddd

in jsx

const React = require('react');
const nl2br = require('react-nl2br');
var Hello = React.createClass({
  render: function() {
    return (
      <div>Hello {nl2br(this.props.name)}</div>
    );
  }
});

INSTALL

$ npm install react-nl2br -S

react-nl2br's People

Contributors

chocoby avatar danbovey avatar dependabot[bot] avatar haydnhkim avatar honeroku avatar hoto17296 avatar lorenzos avatar renovate-bot avatar renovate[bot] avatar tetsugi avatar williamboman avatar yosuke-furukawa avatar zakaratcha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-nl2br's Issues

React should be a peerDependency, not a dependency of react-nl2br

We noticed that we were getting a second copy of React included in our application bundle, and this was due to react-nl2br declaring React as a dependency.

Since the expectation would be that the host project would be using React, and you want react-nl2br to use the host project's copy of React, react-nl2br should list React as a peerDependency in package.json, not as a dependency.

Correct versioning

Hey,

The last version release is 0.0.3, but the previous one was 0.1.0.
In order to work correctly with semver, we need to release a new version that should be 0.2.0, then replublish on npm.

iterator should use key

When I use your nl2br I get:
Warning: Each child in an array or iterator should have a unique "key" prop.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @types/react 18.2.18
  • mocha 10.0.0
  • react ^15.7.0 || ^16.14.0 || ^17.0.0 || ^18.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Warning in Next.js 13 (and maybe React 18?)

When I use this in my Next.js 13 project, I get the following warning in the console:

Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey};
  <br {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {};
  <br key={someKey} {...props} />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.