Code Monkey home page Code Monkey logo

Comments (3)

Dean177 avatar Dean177 commented on May 30, 2024

Hi @mrclay

The API for withUrlState forces you to provide initial values for your state, in the color change example you can see this on the last line. I think this covers what you are suggesting with expected names / defaults.

Im not sure what you mean by validators, can you expand on that a little bit?

from use-url-state.

mrclay avatar mrclay commented on May 30, 2024

An attacker can easily send a user to a page with arbitrary querystring, which gets injected right into props. It should be safe, but I wouldn't gamble on it being harmless in all apps. Hopefully no one's dumb enough to render something from props.urlState as raw markup! OK, at least markup script injection isn't an issue.

from use-url-state.

Dean177 avatar Dean177 commented on May 30, 2024

That's a good point, at the moment the onus is on the user to make sure that they are validating what comes in from the query param. I will have a think about if this is best handled in the docs or by adding additional features.

from use-url-state.

Related Issues (13)

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.